Skip to content
Snippets Groups Projects
Commit c1cdce5d authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avformat/matroskadec: Check av_mallocz() return values

parent ff0c5593
No related branches found
No related tags found
No related merge requests found
......@@ -2507,6 +2507,8 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska,
return AVERROR_INVALIDDATA;
pkt = av_mallocz(sizeof(*pkt));
if (!pkt)
return AVERROR(ENOMEM);
err = av_new_packet(pkt, text_len);
if (err < 0) {
av_free(pkt);
......@@ -2592,6 +2594,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
offset = 8;
pkt = av_mallocz(sizeof(AVPacket));
if (!pkt)
return AVERROR(ENOMEM);
/* XXX: prevent data copy... */
if (av_new_packet(pkt, pkt_size + offset) < 0) {
av_free(pkt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment