[FFmpeg-cvslog] avcodec/sunrast: Fix input buffer pointer check

Michael Niedermayer git at videolan.org
Mon Dec 5 19:46:47 EET 2016


ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov  1 19:24:49 2016 +0100| [eaf2f750c35677f16097ceb45a69a6051ac72853] | committer: Michael Niedermayer

avcodec/sunrast: Fix input buffer pointer check

Fixes: out of array read
Fixes: poc.dat

Found-by: Bingchang, Liu @VARAS of IIE
Tested-by: bc L <l.bing.chang.bc at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 37138338ff602803d174b13fecd363a083bc2f9a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/sunrast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c
index 25e11f6..0af5626 100644
--- a/libavcodec/sunrast.c
+++ b/libavcodec/sunrast.c
@@ -168,7 +168,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
         }
     } else {
         for (y = 0; y < h; y++) {
-            if (buf_end - buf < len)
+            if (buf_end - buf < alen)
                 break;
             memcpy(ptr, buf, len);
             ptr += stride;



More information about the ffmpeg-cvslog mailing list