summaryrefslogtreecommitdiff
path: root/libavformat/ogg.c
diff options
context:
space:
mode:
authorJindřich Makovička <makovick@gmail.com>2005-12-17 17:57:03 +0000
committerJindřich Makovička <makovick@gmail.com>2005-12-17 17:57:03 +0000
commitd76319b1ab716320f6e6a4d690b85fe4504ebd5b (patch)
tree60e46ea97983711974a83c54752d0795c9707928 /libavformat/ogg.c
parent63d33cf4390a9280b1ba42ee722f3140cf1cad3e (diff)
malloc padding to avoid reading past the malloc()ed area.
Credits to Mikulas Patocka (mikulas at artax karlin mff cuni cz) Originally committed as revision 4748 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ogg.c')
-rw-r--r--libavformat/ogg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/ogg.c b/libavformat/ogg.c
index 41fa0d92e0..53c8b05826 100644
--- a/libavformat/ogg.c
+++ b/libavformat/ogg.c
@@ -216,6 +216,7 @@ static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap)
return -1;
codec->extradata_size+= 2 + op.bytes;
codec->extradata= av_realloc(codec->extradata, codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(codec->extradata + codec->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
p= codec->extradata + codec->extradata_size - 2 - op.bytes;
*(p++)= op.bytes>>8;
*(p++)= op.bytes&0xFF;