mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avpacket: Check buffer reference
CC: libav-stable@libav.org Bug-Id: CID 1267889
This commit is contained in:
parent
31dc73e92a
commit
fe0f4e5657
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user