]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/jpeglsdec.c
avcodec/mips: Improve avc avg mc 22, 11, 31, 13 and 33 msa functions
[ffmpeg] / libavcodec / jpeglsdec.c
index 64505321affe3acffe9e1d94a88d0a96e019a7e8..5308b744df1fde9a8c1a7c31575bb7d1fadffab7 100644 (file)
@@ -233,6 +233,9 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
     while (x < w) {
         int err, pred;
 
+        if (get_bits_left(&s->gb) <= 0)
+            return;
+
         /* compute gradients */
         Ra = x ? R(dst, x - stride) : R(last, x);
         Rb = R(last, x);
@@ -443,6 +446,10 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
         avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
         ret = AVERROR_PATCHWELCOME;
         goto end;
+    } else { /* unknown interleaving */
+        avpriv_report_missing_feature(s->avctx, "Unknown interleaved images");
+        ret = AVERROR_PATCHWELCOME;
+        goto end;
     }
 
     if (s->xfrm && s->nb_components == 3) {