[FFmpeg-devel] [PATCH 2/2] avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error
Michael Niedermayer
michael at niedermayer.cc
Sat Feb 12 23:13:50 EET 2022
Fixes: Timeout
Fixes: Invalid shift
Fixes: 44548/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-556487680891289
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/jpeglsdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 6ca723f797..1766b8f09c 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -200,6 +200,8 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state,
#endif
ret = get_ur_golomb_jpegls(gb, k, state->limit - limit_add - 1,
state->qbpp);
+ if(ret < 0)
+ return -0x10000;
/* decode mapped error */
map = 0;
--
2.17.1
More information about the ffmpeg-devel
mailing list