From 622ef80e3f5fae400e22aa1417b012d323c04eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sat, 6 Jun 2015 12:55:20 +0200 Subject: [PATCH] avcodec/mpegvideo: use av_clip() instead of nested min & max Note: MpegEncContext.mb_{y,height} are int fields, as well as local off variable. --- libavcodec/mpegvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index d4a84d43e3..57d9620062 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; }