diff options
author | Vittorio Giovara | 2015-02-02 20:53:51 +0100 |
---|---|---|
committer | Vittorio Giovara | 2015-02-17 12:16:43 -0500 |
commit | fe0f4e56577a2dbd373bb50b0ae2d49e69d822fc (patch) | |
tree | f642c2df6e7dd71ea4aa0c53cc4e4329fb46ed9a /libavcodec | |
parent | 31dc73e92a96f08d07650c0e7d31c0b9a1465d46 (diff) |
avpacket: Check buffer reference
CC: libav-stable@libav.org
Bug-Id: CID 1267889
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avpacket.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 25eabdb215..557258d839 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -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; |