diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-07-13 01:09:43 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-07-13 01:09:43 +0000 |
commit | d3abbb1d13638889ada1154905bbbdffb3935217 (patch) | |
tree | 78286044f0a8b88a5d3bc0c7bef072cddfa1abcc | |
parent | 81fe2e8b366e59bc12e0a2d7db3debdfb70c5a9e (diff) | |
download | ffmpeg-d3abbb1d13638889ada1154905bbbdffb3935217.tar.gz |
lavc: fix ff_alloc_packet()
Regression introduced in 740b9ff44.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a326815bc4..5afa3e7e97 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; |