diff options
author | James Almer <jamrial@gmail.com> | 2018-02-20 10:25:54 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-02-20 10:25:54 -0300 |
commit | 88eb368f4210fc2975666f9cb89504b3374094ab (patch) | |
tree | aeb8d1d1261b5100f1def340ffb316cd0cecf635 /libavformat | |
parent | acdea9e7c56b74b05c56b4733acc855b959ba073 (diff) | |
download | ffmpeg-88eb368f4210fc2975666f9cb89504b3374094ab.tar.gz |
avformat/matroskadec: free the packet on webvtt side data allocation failure
Fixes potential memory leaks
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index edc4f5d476..bf0e47ce3a 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3121,6 +3121,7 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska, AV_PKT_DATA_WEBVTT_IDENTIFIER, id_len); if (!buf) { + av_packet_unref(pkt); av_free(pkt); return AVERROR(ENOMEM); } @@ -3132,6 +3133,7 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska, AV_PKT_DATA_WEBVTT_SETTINGS, settings_len); if (!buf) { + av_packet_unref(pkt); av_free(pkt); return AVERROR(ENOMEM); } |