]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264_mp4toannexb_bsf.c
electronicarts: Check packet sizes before reading
[ffmpeg] / libavcodec / h264_mp4toannexb_bsf.c
index 86b948a31740085e1490d778653568d5566935b5..e86c3e10b59557885d5132bc8a9eefe00c52d639 100644 (file)
@@ -40,7 +40,7 @@ static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
     void *tmp;
 
     *poutbuf_size += sps_pps_size + in_size + nal_header_size;
-    tmp = av_realloc(*poutbuf, *poutbuf_size);
+    tmp = av_realloc(*poutbuf, *poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!tmp)
         return AVERROR(ENOMEM);
     *poutbuf = tmp;