h264_mp4toannexb_bsf: return a padded buffer
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 11 Jun 2013 15:57:31 +0000 (17:57 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 15 Jun 2013 14:14:45 +0000 (16:14 +0200)
The code using the returned buffer might expect it to be
FF_INPUT_BUFFER_PADDING_SIZE padded as any other avpacket.

libavcodec/h264_mp4toannexb_bsf.c

index 86b948a..e86c3e1 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;