avformat/matroskadec: Check av_mallocz() return values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ff0c559329
commit
c1cdce5dcb
@ -2507,6 +2507,8 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
pkt = av_mallocz(sizeof(*pkt));
|
pkt = av_mallocz(sizeof(*pkt));
|
||||||
|
if (!pkt)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
err = av_new_packet(pkt, text_len);
|
err = av_new_packet(pkt, text_len);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
av_free(pkt);
|
av_free(pkt);
|
||||||
@ -2592,6 +2594,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
|
|||||||
offset = 8;
|
offset = 8;
|
||||||
|
|
||||||
pkt = av_mallocz(sizeof(AVPacket));
|
pkt = av_mallocz(sizeof(AVPacket));
|
||||||
|
if (!pkt)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
/* XXX: prevent data copy... */
|
/* XXX: prevent data copy... */
|
||||||
if (av_new_packet(pkt, pkt_size + offset) < 0) {
|
if (av_new_packet(pkt, pkt_size + offset) < 0) {
|
||||||
av_free(pkt);
|
av_free(pkt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user