Commit 61f6500a authored by conrad's avatar conrad

Ensure that the extradata buffer is padded appripriately in the ogg demuxer.

Spotted by valgrind.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19119 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0bc437a4
...@@ -47,7 +47,8 @@ static int speex_header(AVFormatContext *s, int idx) { ...@@ -47,7 +47,8 @@ static int speex_header(AVFormatContext *s, int idx) {
st->codec->channels = AV_RL32(p + 48); st->codec->channels = AV_RL32(p + 48);
st->codec->frame_size = AV_RL32(p + 56); st->codec->frame_size = AV_RL32(p + 56);
st->codec->extradata_size = os->psize; 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); memcpy(st->codec->extradata, p, st->codec->extradata_size);
st->time_base.num = 1; st->time_base.num = 1;
......
...@@ -106,7 +106,8 @@ theora_header (AVFormatContext * s, int idx) ...@@ -106,7 +106,8 @@ theora_header (AVFormatContext * s, int idx)
vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 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 = st->codec->extradata + st->codec->extradata_size;
*cdp++ = os->psize >> 8; *cdp++ = os->psize >> 8;
*cdp++ = os->psize & 0xff; *cdp++ = os->psize & 0xff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment