From f03c0f6afcb1360c95e92cf9278a8f43ca5cdb9f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 17 Oct 2012 20:45:59 +0200 Subject: [PATCH] ffmdec: check av_new_packet() return value Fixes CID733711 Signed-off-by: Michael Niedermayer --- libavformat/ffmdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index d4e605680a..028f1ee797 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -386,7 +386,9 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt) duration = AV_RB24(ffm->header + 5); - av_new_packet(pkt, size); + if (av_new_packet(pkt, size) < 0) { + return AVERROR(ENOMEM); + } pkt->stream_index = ffm->header[0]; if ((unsigned)pkt->stream_index >= s->nb_streams) { av_log(s, AV_LOG_ERROR, "invalid stream index %d\n", pkt->stream_index); -- 2.11.0