]> git.sesse.net Git - ffmpeg/commitdiff
buffer overflow
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Feb 2005 23:36:04 +0000 (23:36 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Feb 2005 23:36:04 +0000 (23:36 +0000)
Originally committed as revision 3954 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/pcm.c

index 13a16e7475f45667c89de428abd48167b85ac990..8e57d11a1c50db07590a5197544e80c7a5946d6d 100644 (file)
@@ -299,6 +299,9 @@ static int pcm_decode_frame(AVCodecContext *avctx,
     samples = data;
     src = buf;
 
+    if(buf_size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2)
+        buf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE/2;
+
     switch(avctx->codec->id) {
     case CODEC_ID_PCM_S16LE:
         n = buf_size >> 1;