[FFmpeg-cvslog] h264_mp4toannexb_bsf: return a padded buffer

Luca Barbato git at videolan.org
Sun Jun 16 23:11:03 CEST 2013


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Jun 11 17:57:31 2013 +0200| [9e80eda26d06c7c48dbec5dfe643c857c62c0ee7] | committer: Luca Barbato

h264_mp4toannexb_bsf: return a padded buffer

The code using the returned buffer might expect it to be
FF_INPUT_BUFFER_PADDING_SIZE padded as any other avpacket.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e80eda26d06c7c48dbec5dfe643c857c62c0ee7
---

 libavcodec/h264_mp4toannexb_bsf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index 86b948a..e86c3e1 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -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;



More information about the ffmpeg-cvslog mailing list