diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index d7f94c10c2..8f67542baf 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -438,7 +438,7 @@ static void guess_mv(ERContext *s) } if ((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || - num_avail <= mb_width / 2) { + num_avail <= FFMAX(mb_width, mb_height) / 2) { for (mb_y = 0; mb_y < mb_height; mb_y++) { for (mb_x = 0; mb_x < s->mb_width; mb_x++) { const int mb_xy = mb_x + mb_y * s->mb_stride;