1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

Merge commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5'

* commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5':
  mmal: Fix AVBufferRef usage

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
Hendrik Leppkes 2015-09-26 11:07:54 +02:00
commit 2b61cc4443

View File

@ -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 {