[FFmpeg-cvslog] lavc: fix ff_alloc_packet()
Paul B Mahol
git at videolan.org
Fri Jul 13 03:42:53 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Jul 13 01:09:43 2012 +0000| [d3abbb1d13638889ada1154905bbbdffb3935217] | committer: Paul B Mahol
lavc: fix ff_alloc_packet()
Regression introduced in 740b9ff44.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3abbb1d13638889ada1154905bbbdffb3935217
---
libavcodec/utils.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a326815..5afa3e7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1017,6 +1017,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size)
return AVERROR(EINVAL);
}
+ if (avctx) {
av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
if (!avpkt->data || avpkt->size < size) {
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
@@ -1024,6 +1025,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size)
avpkt->size = avctx->internal->byte_buffer_size;
avpkt->destruct = NULL;
}
+ }
if (avpkt->data) {
void *destruct = avpkt->destruct;
More information about the ffmpeg-cvslog
mailing list