diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-30 23:27:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 19:11:07 +0100 |
commit | 5c1e9d3722db553c2bc08c9fd878b4be153566c4 (patch) | |
tree | 098d1832486c2ee589693d783fcad8c73423a71b | |
parent | b56e9beeb83898a8531d2e3f2105a9b65c94cf21 (diff) | |
download | ffmpeg-5c1e9d3722db553c2bc08c9fd878b4be153566c4.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>
-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 0e344f54d8..1dda2073e5 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -148,6 +148,8 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, ret = ret >> 1; } + if(FFABS(ret) > 0xFFFF) + return -0x10000; /* update state */ state->A[Q] += FFABS(ret) - RItype; ret *= state->twonear; |