Commit 88eb368f authored by James Almer's avatar James Almer

avformat/matroskadec: free the packet on webvtt side data allocation failure

Fixes potential memory leaks
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent acdea9e7
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment