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:39:40 +0100
commit02ac859dfe1febbe467a84b1edef6bf8c33b9ffb (patch)
treec56b72d6a4e1e07e0deaa7c094acc59fb08fc405
parent04fb6bb9155a5b1857027b78728badec72734c2e (diff)
downloadffmpeg-02ac859dfe1febbe467a84b1edef6bf8c33b9ffb.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index fdf4c4c424..1eb8c05f51 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;