[FFmpeg-devel] [PATCH]lavc/avpacket: Initialize a variable in error path

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Feb 17 01:49:05 EET 2017


Hi!

Attached patch is said to fix undefined behaviour, see ticket #6153, I cannot 
reproduce.

Please comment, Carl Eugen
-------------- next part --------------
From 8bbd58c465deb28737586c9292d57ab75e3de32c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
Date: Fri, 17 Feb 2017 00:46:14 +0100
Subject: [PATCH] lavc/avpacket: Initialize a variable in error path.

Fixes ticket #6153.
---
 libavcodec/avpacket.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 24b4efb..8e028a2 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -348,6 +348,8 @@ uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
             return pkt->side_data[i].data;
         }
     }
+    if (size)
+        *size = 0;
     return NULL;
 }
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list