[FFmpeg-cvslog] avcodec/jpeglsdec: check err value for ls_get_code_runterm()
Michael Niedermayer
git at videolan.org
Sun Nov 17 20:06:23 CET 2013
ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 30 23:27:28 2013 +0100| [5c1e9d3722db553c2bc08c9fd878b4be153566c4] | committer: Michael Niedermayer
avcodec/jpeglsdec: check err value for ls_get_code_runterm()
Fixes infinite loop
Fixes Ticket3086
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit cc0e47b55096361723b364afa43b79a3f5619cdc)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c1e9d3722db553c2bc08c9fd878b4be153566c4
---
libavcodec/jpeglsdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 0e344f5..1dda207 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;
More information about the ffmpeg-cvslog
mailing list