projects
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c0c8e5
)
lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to memcpy().
author
Carl Eugen Hoyos
<cehoyos@ag.or.at>
Sun, 4 Sep 2016 19:11:02 +0000
(21:11 +0200)
committer
Mike Gabriel
<sunweaver@debian.org>
Sat, 31 Aug 2019 15:36:55 +0000
(16:36 +0100)
Fixes ticket #5128.
Gbp-Pq: Name CVE-2018-5766.patch
libavcodec/avpacket.c
patch
|
blob
|
history
diff --git
a/libavcodec/avpacket.c
b/libavcodec/avpacket.c
index cad804798495efeb2de9535b9cf27e5ae6ce70f4..10ee1a439c359bc1a8ee2829bed5916ae56ceb7e 100644
(file)
--- a/
libavcodec/avpacket.c
+++ b/
libavcodec/avpacket.c
@@
-364,7
+364,8
@@
int av_packet_ref(AVPacket *dst, AVPacket *src)
ret = packet_alloc(&dst->buf, src->size);
if (ret < 0)
goto fail;
- memcpy(dst->buf->data, src->data, src->size);
+ if (src->size)
+ memcpy(dst->buf->data, src->data, src->size);
dst->data = dst->buf->data;
} else {