summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-12-08 01:21:11 -0300
committerJames Almer <jamrial@gmail.com>2016-12-08 01:21:11 -0300
commit8396d54d3c627006b4131df8c1656f1762313886 (patch)
treebad78e3f71d5dd9262ae5bceb2e50cc625635cbb /libavformat/matroskadec.c
parent3ab1311aba74a28cebfc22985cd9250fda93e6cf (diff)
avformat/matroskadec: fix memleak on stream side data failure
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index f4a452ef0a..efacca9c01 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;
}