[FFmpeg-cvslog] jpeglsdec: fix infinite loop
Michael Niedermayer
git at videolan.org
Wed Sep 21 21:08:29 CEST 2011
ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 8 05:05:11 2011 +0200| [d99613bad60cd2640d15725581ef8fe14d9a6258] | committer: Michael Niedermayer
jpeglsdec: fix infinite loop
Fixes Ticket331
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit bd358e128f47c14c7bc9dfceb8dedb3e5697f017)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d99613bad60cd2640d15725581ef8fe14d9a6258
---
libavcodec/jpegls.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/jpegls.h b/libavcodec/jpegls.h
index 28c7524..2c21f77 100644
--- a/libavcodec/jpegls.h
+++ b/libavcodec/jpegls.h
@@ -86,6 +86,8 @@ static inline void ff_jpegls_downscale_state(JLSState *state, int Q){
}
static inline int ff_jpegls_update_state_regular(JLSState *state, int Q, int err){
+ if(FFABS(err) > 0xFFFF)
+ return -0x10000;
state->A[Q] += FFABS(err);
err *= state->twonear;
state->B[Q] += err;
More information about the ffmpeg-cvslog
mailing list