aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-30 23:27:28 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-04 20:49:49 +0100
commit58e212c1fbad5df87ea91c85711361325cc84be1 (patch)
treee0f8b081be2e0a494afcaf10a22b731c15566e10
parent4ddbe89d40bd7a6ba16a6537b0acdd22f6c86507 (diff)
downloadffmpeg-n0.10.10.tar.gz
avcodec/jpeglsdec: check err value for ls_get_code_runterm()n0.10.10
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 7814ad6640..b95a15126e 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -143,6 +143,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;