summaryrefslogtreecommitdiff
path: root/libavformat/oggparsespeex.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-06-05 23:39:11 +0000
committerDavid Conrad <lessen42@gmail.com>2009-06-05 23:39:11 +0000
commit12d7c0793be4348751ba1303d8cbbb0750f1f33b (patch)
treebfb017cf649f7e5ecf8dcc23cf2915706292f39d /libavformat/oggparsespeex.c
parent8dbd0a95eea3b30dcef8ab4d0424b624f982313a (diff)
Ensure that the extradata buffer is padded appripriately in the ogg demuxer.
Spotted by valgrind. Originally committed as revision 19119 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/oggparsespeex.c')
-rw-r--r--libavformat/oggparsespeex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c
index 0ac087d7ae..140a58a9eb 100644
--- a/libavformat/oggparsespeex.c
+++ b/libavformat/oggparsespeex.c
@@ -47,7 +47,8 @@ static int speex_header(AVFormatContext *s, int idx) {
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;