jpegls: fix off limit
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 01:49:11 +0000 (03:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 01:54:04 +0000 (03:54 +0200)
Fixes part of CID717913
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeglsdec.c

index db230cf..516a82f 100644 (file)
@@ -295,7 +295,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
     }
     if(ilv == 0) { /* separate planes */
         stride = (s->nb_components > 1) ? 3 : 1;
-        off = av_clip(s->cur_scan - 1, 0, stride);
+        off = av_clip(s->cur_scan - 1, 0, stride - 1);
         width = s->width * stride;
         cur += off;
         for(i = 0; i < s->height; i++) {