diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-30 23:27:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-16 00:35:12 +0100 |
commit | 751e684aae1e44799bd2ed0dcc93f4ecf9db4b53 (patch) | |
tree | 109fdc9f03d09a7e30ca358d254e8b340d4ca843 /libavcodec | |
parent | 803ca5c3491a295a52cc7f2b1b583468d21a953f (diff) | |
download | ffmpeg-751e684aae1e44799bd2ed0dcc93f4ecf9db4b53.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')
-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 516a82fc90..10fe31a64f 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; |