From: Clément Bœsch Date: Sat, 6 Jun 2015 10:55:20 +0000 (+0200) Subject: avcodec/mpegvideo: use av_clip() instead of nested min & max X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=622ef80e3f5fae400e22aa1417b012d323c04eed;p=ffmpeg avcodec/mpegvideo: use av_clip() instead of nested min & max Note: MpegEncContext.mb_{y,height} are int fields, as well as local off variable. --- diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index d4a84d43e38..57d96200622 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2776,7 +2776,7 @@ int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir) off = ((FFMAX(-my_min, my_max)<> 6; - return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1); + return av_clip(s->mb_y + off, 0, s->mb_height - 1); unhandled: return s->mb_height-1; }