changeset 2506:9404bbf9de07 libavcodec

buffer overflow
author michael
date Sun, 13 Feb 2005 23:36:04 +0000
parents 86e2b1424801
children 0334caf0f0ce
files pcm.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pcm.c	Mon Feb 07 17:09:48 2005 +0000
+++ b/pcm.c	Sun Feb 13 23:36:04 2005 +0000
@@ -299,6 +299,9 @@
     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;