Commit f03c0f6a authored by Michael Niedermayer's avatar Michael Niedermayer

ffmdec: check av_new_packet() return value

Fixes CID733711
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a0e0e1e1
...@@ -386,7 +386,9 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -386,7 +386,9 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
duration = AV_RB24(ffm->header + 5); 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]; pkt->stream_index = ffm->header[0];
if ((unsigned)pkt->stream_index >= s->nb_streams) { if ((unsigned)pkt->stream_index >= s->nb_streams) {
av_log(s, AV_LOG_ERROR, "invalid stream index %d\n", pkt->stream_index); av_log(s, AV_LOG_ERROR, "invalid stream index %d\n", pkt->stream_index);
......
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