[FFmpeg-cvslog] avcodec/jpeglsdec: check err value for ls_get_code_runterm()

Michael Niedermayer git at videolan.org
Sun Jul 20 18:38:46 CEST 2014


ffmpeg | branch: release/0.5 | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 30 23:27:28 2013 +0100| [02ac859dfe1febbe467a84b1edef6bf8c33b9ffb] | 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=02ac859dfe1febbe467a84b1edef6bf8c33b9ffb
---

 libavcodec/jpeglsdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index fdf4c4c..1eb8c05 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;



More information about the ffmpeg-cvslog mailing list