Commit fe0f4e56 authored by Vittorio Giovara's avatar Vittorio Giovara

avpacket: Check buffer reference

CC: libav-stable@libav.org
Bug-Id: CID 1267889
parent 31dc73e9
......@@ -365,8 +365,13 @@ int av_packet_ref(AVPacket *dst, AVPacket *src)
if (ret < 0)
goto fail;
memcpy(dst->buf->data, src->data, src->size);
} else
} else {
dst->buf = av_buffer_ref(src->buf);
if (!dst->buf) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
dst->size = src->size;
dst->data = dst->buf->data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment