mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to memcpy().
Fixes ticket #5857.
This commit is contained in:
parent
7447ec91b5
commit
c54eef46f9
@ -139,7 +139,8 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
|
||||
pkt->buf = av_buffer_alloc(new_size);
|
||||
if (!pkt->buf)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(pkt->buf->data, pkt->data, pkt->size);
|
||||
if (pkt->size > 0)
|
||||
memcpy(pkt->buf->data, pkt->data, pkt->size);
|
||||
pkt->data = pkt->buf->data;
|
||||
}
|
||||
pkt->size += grow_by;
|
||||
|
Loading…
Reference in New Issue
Block a user