1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00

Check for invalid packet size in the smacker demuxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Laurent Aimar 2011-09-12 20:50:13 +02:00 committed by Michael Niedermayer
parent 7cb35d4954
commit ecd6fa11c2

View File

@ -292,6 +292,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
}
flags >>= 1;
}
if (frame_size < 0)
return AVERROR_INVALIDDATA;
if (av_new_packet(pkt, frame_size + 768))
return AVERROR(ENOMEM);
if(smk->frm_size[smk->cur_frame] & 1)