avformat/matroskadec: fix memleak on stream side data failure
authorJames Almer <jamrial@gmail.com>
Thu, 8 Dec 2016 04:21:11 +0000 (01:21 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 8 Dec 2016 04:21:11 +0000 (01:21 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/matroskadec.c

index f4a452e..efacca9 100644 (file)
@@ -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;
 }