diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-04-26 12:39:45 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-04-26 12:39:45 +0000 |
commit | a82dcdffb27b74986c75b6313bbc245535c39c49 (patch) | |
tree | d26f2dec4fced702b91c2bf0b95345d6e3e8a95c /libavcodec/mpegaudiodec.c | |
parent | dfcd6d91fe8037c1b31c2c29c3593cf5374af08e (diff) | |
download | ffmpeg-a82dcdffb27b74986c75b6313bbc245535c39c49.tar.gz |
return error if buf_size is too small
Originally committed as revision 12981 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index feae64e0d1..3d071627be 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -2570,11 +2570,10 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, len = buf_size; + *data_size = 0; // Discard too short frames - if (buf_size < HEADER_SIZE) { - *data_size = 0; - return buf_size; - } + if (buf_size < HEADER_SIZE) + return -1; // If only one decoder interleave is not needed outptr = s->frames == 1 ? out_samples : decoded_buf; |