# HG changeset patch # User conrad # Date 1244245151 0 # Node ID 53092c7684a2994e68c69bd22af36cc8a3295910 # Parent 84a7b7a2f2524a9092357803d30acc448c0b19e2 Ensure that the extradata buffer is padded appripriately in the ogg demuxer. Spotted by valgrind. diff -r 84a7b7a2f252 -r 53092c7684a2 oggparsespeex.c --- a/oggparsespeex.c Thu Jun 04 06:25:53 2009 +0000 +++ b/oggparsespeex.c Fri Jun 05 23:39:11 2009 +0000 @@ -47,7 +47,8 @@ st->codec->channels = AV_RL32(p + 48); st->codec->frame_size = AV_RL32(p + 56); st->codec->extradata_size = os->psize; - st->codec->extradata = av_malloc(st->codec->extradata_size); + st->codec->extradata = av_malloc(st->codec->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(st->codec->extradata, p, st->codec->extradata_size); st->time_base.num = 1; diff -r 84a7b7a2f252 -r 53092c7684a2 oggparsetheora.c --- a/oggparsetheora.c Thu Jun 04 06:25:53 2009 +0000 +++ b/oggparsetheora.c Fri Jun 05 23:39:11 2009 +0000 @@ -106,7 +106,8 @@ vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 8); } - st->codec->extradata = av_realloc (st->codec->extradata, cds); + st->codec->extradata = av_realloc (st->codec->extradata, + cds + FF_INPUT_BUFFER_PADDING_SIZE); cdp = st->codec->extradata + st->codec->extradata_size; *cdp++ = os->psize >> 8; *cdp++ = os->psize & 0xff;