aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-01 19:24:49 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-04 20:25:15 +0100
commitbc63205ae2eb3ecb16a61118c125e214daa3384b (patch)
treef371e8e2ef338cf65a126aa08b014ac28aa4dd64
parent4251dc6d7e7d6e3c0396ab7bdb9d3259112ed351 (diff)
downloadffmpeg-bc63205ae2eb3ecb16a61118c125e214daa3384b.tar.gz
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@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 37138338ff602803d174b13fecd363a083bc2f9a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/sunrast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c
index 25e11f6cd2..0af5626e35 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;