Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-03 01:17:21 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 04:18:08 +0400
commit06e7d58410a17dc72c30ee7f3145fcacc425f4f2 (patch)
treec0bdd9a82901bc82a41459c276b2c4f70d32b396 /libavcodec/jpeglsdec.c
parent77b3e110d2de8cd8860f60c705c141c57c981aeb (diff)
avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
previously it could have been by 1 too large Fixes out of array access Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeglsdec.c')
-rw-r--r--libavcodec/jpeglsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index fb3762dad0..bb8c264ae0 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -269,6 +269,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
x += stride;
}
+ if (x >= w) {
+ av_log(NULL, AV_LOG_ERROR, "run overflow\n");
+ return;
+ }
+
/* decode run termination value */
Rb = R(last, x);
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;