aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-12 20:50:13 +0200
committerReinhard Tartler <siretart@tauware.de>2011-12-24 12:20:33 +0100
commit6f70111e817ea83cfad8cc9be313c2c05cb2d28b (patch)
tree6f4c12864a1e8bf7ce8e5c69db66be3db05c084f
parent44925239383d54af3d329fb5b12345f6209e8e62 (diff)
downloadffmpeg-6f70111e817ea83cfad8cc9be313c2c05cb2d28b.tar.gz
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> Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavformat/smacker.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 056e9dc22f..a916a7bdf1 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -306,6 +306,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)