diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-26 11:07:54 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-26 11:07:54 +0200 |
commit | 2b61cc44433e47c98ec3336bea14f69fdfc9c616 (patch) | |
tree | 29541a3bec369e7c2f092e11bc33f06ad7c75439 | |
parent | f3310df8538d201e8623ffbcf7f4fee0bec94f83 (diff) | |
parent | a9b8c638cfe2f82191db65e3e3a39f3b35df81f5 (diff) | |
download | ffmpeg-2b61cc44433e47c98ec3336bea14f69fdfc9c616.tar.gz |
Merge commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5'
* commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5':
mmal: Fix AVBufferRef usage
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r-- | libavcodec/mmaldec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 43edb7fd24..ecac924689 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -433,17 +433,20 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt, if (avpkt->size) { if (avpkt->buf) { buf = av_buffer_ref(avpkt->buf); + size = avpkt->size; + data = avpkt->data; } else { buf = av_buffer_alloc(avpkt->size); - if (buf) + if (buf) { memcpy(buf->data, avpkt->data, avpkt->size); + size = buf->size; + data = buf->data; + } } if (!buf) { ret = AVERROR(ENOMEM); goto done; } - size = buf->size; - data = buf->data; if (!is_extradata) ctx->packets_sent++; } else { |