Merge commit '8dc4b2c92e492aa172327d10c926d5ca3a04371c' into release/1.1
[ffmpeg.git] / libavcodec / pictordec.c
index 7c8f7e9..8a173af 100644 (file)
@@ -237,6 +237,8 @@ static int decode_frame(AVCodecContext *avctx,
 
                 if (bits_per_plane == 8) {
                     picmemset_8bpp(s, val, run, &x, &y);
+                    if (y < 0)
+                        goto finish;
                 } else {
                     picmemset(s, val, run, &x, &y, &plane, bits_per_plane);
                 }
@@ -257,6 +259,7 @@ static int decode_frame(AVCodecContext *avctx,
             y--;
         }
     }
+finish:
 
     *got_frame      = 1;
     *(AVFrame*)data = s->frame;