diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-30 23:27:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-07 04:04:07 +0100 |
commit | 15d96c605bf213b4e07c6b8d08cebf8595832f9f (patch) | |
tree | 8d523b007584b9b28164391a2f66dfa160ada97d /libavcodec/jpeglsdec.c | |
parent | 67c3e3de55a43c0df0ca510baf1985c8ff5991eb (diff) | |
download | ffmpeg-15d96c605bf213b4e07c6b8d08cebf8595832f9f.tar.gz |
avcodec/jpeglsdec: check err value for ls_get_code_runterm()
Fixes infinite loop
Fixes Ticket3086
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc0e47b55096361723b364afa43b79a3f5619cdc)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeglsdec.c')
-rw-r--r-- | libavcodec/jpeglsdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 4ab68da8b4..60bf569a1f 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -142,6 +142,8 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI ret = ret >> 1; } + if(FFABS(ret) > 0xFFFF) + return -0x10000; /* update state */ state->A[Q] += FFABS(ret) - RItype; ret *= state->twonear; |