aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-03-28 11:53:01 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-03-28 11:53:01 +0000
commit5508d26b7c22ba05cd036bfe58c9658f9afc0ee0 (patch)
tree780920137d6ab8e76c5e5b42e48b99b5dc8afeb9
parentc367d06702b3a9cb6b5cf02435f76c5dd5f321e7 (diff)
downloadffmpeg-5508d26b7c22ba05cd036bfe58c9658f9afc0ee0.tar.gz
fix decoding of big audio packets (48k 16bit 2 channels), needed size is related to samples which is short * while len passed to decode_audio2 is related to pkt->data which is uint8_t *
Originally committed as revision 8537 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 2ee0011180..3f12c1f089 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1049,7 +1049,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
switch(ist->st->codec->codec_type) {
case CODEC_TYPE_AUDIO:{
if(pkt)
- samples= av_fast_realloc(samples, &samples_size, FFMAX(pkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE));
+ samples= av_fast_realloc(samples, &samples_size, FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE));
data_size= samples_size;
/* XXX: could avoid copy if PCM 16 bits with same
endianness as CPU */