[FFmpeg-cvslog] avformat/swfdec: Fix inflate() error code check

Michael Niedermayer git at videolan.org
Mon Sep 5 02:24:47 EEST 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Fri Aug 19 10:28:22 2016 +0200| [ca92adafb0effac6c51a12f90a593ba7e8b3ee90] | committer: Michael Niedermayer

avformat/swfdec: Fix inflate() error code check

Fixes infinite loop
Fixes endless.poc

Found-by: 连一汉 <lianyihan at 360.cn>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a453bbb68f3eec202673728988bba3bc76071761)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index eb17e82..518ca1f 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -119,10 +119,10 @@ retry:
     z->avail_out = buf_size;
 
     ret = inflate(z, Z_NO_FLUSH);
-    if (ret < 0)
-        return AVERROR(EINVAL);
     if (ret == Z_STREAM_END)
         return AVERROR_EOF;
+    if (ret != Z_OK)
+        return AVERROR(EINVAL);
 
     if (buf_size - z->avail_out == 0)
         goto retry;



More information about the ffmpeg-cvslog mailing list