avcodec/jpeglsdec: check shift for values that cause overflow later

Fixes: 657/clusterfuzz-testcase-6674741433729024
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-02-23 23:13:24 +01:00
parent 76ba09d182
commit e98dfeb27c
1 changed files with 5 additions and 0 deletions

View File

@ -375,6 +375,11 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
else
shift = point_transform + (16 - s->bits);
if (shift >= 16) {
ret = AVERROR_INVALIDDATA;
goto end;
}
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(s->avctx, AV_LOG_DEBUG,
"JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) "