[FFmpeg-cvslog] avcodec/avpacket: clear side_data_elems
Michael Niedermayer
git at videolan.org
Sun Sep 18 01:53:41 EEST 2016
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Mon Sep 12 13:13:42 2016 +0200| [175a95bfddc5a6fb69d329e24fd7157a2e1f2099] | committer: Michael Niedermayer
avcodec/avpacket: clear side_data_elems
Fixes null pointer dereference
Found-by: 连一汉 <lianyihan at 360.cn>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=175a95bfddc5a6fb69d329e24fd7157a2e1f2099
---
libavcodec/avpacket.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 35adb86..bf168be 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -195,6 +195,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
{
pkt->data = NULL;
pkt->side_data = NULL;
+ pkt->side_data_elems = 0;
if (pkt->buf) {
AVBufferRef *ref = av_buffer_ref(src->buf);
if (!ref)
@@ -209,9 +210,11 @@ FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
- if (pkt->side_data_elems && dup)
+ if (src->side_data_elems && dup) {
pkt->side_data = src->side_data;
- if (pkt->side_data_elems && !dup) {
+ pkt->side_data_elems = src->side_data_elems;
+ }
+ if (src->side_data_elems && !dup) {
return av_copy_packet_side_data(pkt, src);
}
return 0;
More information about the ffmpeg-cvslog
mailing list