ffmpeg | branch: master | James Almer <[email protected]> | Thu Dec  8 01:21:11 
2016 -0300| [8396d54d3c627006b4131df8c1656f1762313886] | committer: James Almer

avformat/matroskadec: fix memleak on stream side data failure

Signed-off-by: James Almer <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8396d54d3c627006b4131df8c1656f1762313886
---

 libavformat/matroskadec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index f4a452e..efacca9 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1931,8 +1931,10 @@ static int mkv_parse_video_projection(AVStream *st, 
const MatroskaTrack *track)
 
     ret = av_stream_add_side_data(st, AV_PKT_DATA_SPHERICAL, (uint8_t 
*)spherical,
                                   spherical_size);
-    if (ret < 0)
+    if (ret < 0) {
+        av_freep(&spherical);
         return ret;
+    }
 
     return 0;
 }

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to