From 5be25fc133077c63338561dc8261c7905b4c8eeb Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Sat, 26 Apr 2008 12:51:52 +0000 Subject: simplify using FFMIN3 Originally committed as revision 12983 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpegaudiodec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3d071627be..dcc9332970 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -2581,12 +2581,9 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, for (fr = 0; fr < s->frames; fr++) { start = start2; fsize = (start[0] << 4) | (start[1] >> 4); + fsize = FFMIN3(fsize, len, MPA_MAX_CODED_FRAME_SIZE); start2 += fsize; - if (fsize > len) - fsize = len; len -= fsize; - if (fsize > MPA_MAX_CODED_FRAME_SIZE) - fsize = MPA_MAX_CODED_FRAME_SIZE; m = s->mp3decctx[fr]; assert (m != NULL); -- cgit v1.2.3