avcodec/mpegvideo: use av_clip() instead of nested min & max

Note: MpegEncContext.mb_{y,height} are int fields, as well as local off
variable.
This commit is contained in:
Clément Bœsch 2015-06-06 12:55:20 +02:00
parent 0f6118c581
commit 622ef80e3f
1 changed files with 1 additions and 1 deletions

View File

@ -2776,7 +2776,7 @@ int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir)
off = ((FFMAX(-my_min, my_max)<<qpel_shift) + 63) >> 6; off = ((FFMAX(-my_min, my_max)<<qpel_shift) + 63) >> 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: unhandled:
return s->mb_height-1; return s->mb_height-1;
} }