diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 131d52ac0b..57b5a8fd14 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -419,7 +419,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;