[FFmpeg-cvslog] swfdec: check lens validity

Michael Niedermayer git at videolan.org
Sun Jul 21 03:43:34 CEST 2013


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 10 17:20:32 2012 +0100| [9c7c2abad4a8eb56472dd5651522530855a62f3f] | committer: Michael Niedermayer

swfdec: check lens validity

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c73685398dee3290dd9f67013f1cd310b7f9fb33)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c7c2abad4a8eb56472dd5651522530855a62f3f
---

 libavformat/swfdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 6136b54..9a8ef53 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -153,6 +153,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
         tag = get_swf_tag(pb, &len);
         if (tag < 0)
             return tag;
+        if (len < 0) {
+            av_log(s, AV_LOG_ERROR, "len %d is invalid\n", len);
+            return AVERROR_INVALIDDATA;
+        }
         if (tag == TAG_VIDEOSTREAM) {
             int ch_id = avio_rl16(pb);
             len -= 2;



More information about the ffmpeg-cvslog mailing list