]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/jpeglsdec.c
Merge commit 'd3e4d406b020b0464486318aceda08bd8f69ca41'
[ffmpeg] / libavcodec / jpeglsdec.c
index 68151cbbd8ea987793457542968a82dd4dea357a..c8550e47eac97d43af8470ea6f23a98a0434cf88 100644 (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) "