aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-30 23:27:28 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-10-30 23:32:51 +0100
commitcc0e47b55096361723b364afa43b79a3f5619cdc (patch)
treeff5a340c5ffb198c14abe11aa0c67515c9e2d9d7
parent4fab08c94f836f24c67f75f3e44e82cdbac5ffb2 (diff)
downloadffmpeg-cc0e47b55096361723b364afa43b79a3f5619cdc.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>
-rw-r--r--libavcodec/jpeglsdec.c2
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;