diff sierravmd.c @ 884:2ece9c9dd94c libavformat

malloc padding to avoid reading past the malloc()ed area. Credits to Mikulas Patocka (mikulas at artax karlin mff cuni cz)
author henry
date Sat, 17 Dec 2005 17:57:03 +0000
parents 91dcb9da9be6
children da1d5db0ce5c
line wrap: on
line diff
--- a/sierravmd.c	Sat Dec 17 11:27:37 2005 +0000
+++ b/sierravmd.c	Sat Dec 17 17:57:03 2005 +0000
@@ -137,7 +137,7 @@
     st->codec->width = LE_16(&vmd->vmd_header[12]);
     st->codec->height = LE_16(&vmd->vmd_header[14]);
     st->codec->extradata_size = VMD_HEADER_SIZE;
-    st->codec->extradata = av_malloc(VMD_HEADER_SIZE);
+    st->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
     memcpy(st->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
 
     /* if sample rate is 0, assume no audio */