Merge commit '5f7aecde02a95451e514c809f2794c1deba80695'
[ffmpeg.git] / libavcodec / pictordec.c
index bf138b2..df3380d 100644 (file)
@@ -226,6 +226,8 @@ static int decode_frame(AVCodecContext *avctx,
 
                 if (bits_per_plane == 8) {
                     picmemset_8bpp(s, frame, val, run, &x, &y);
 
                 if (bits_per_plane == 8) {
                     picmemset_8bpp(s, frame, val, run, &x, &y);
+                    if (y < 0)
+                        goto finish;
                 } else {
                     picmemset(s, frame, val, run, &x, &y, &plane, bits_per_plane);
                 }
                 } else {
                     picmemset(s, frame, val, run, &x, &y, &plane, bits_per_plane);
                 }
@@ -246,6 +248,7 @@ static int decode_frame(AVCodecContext *avctx,
             y--;
         }
     }
             y--;
         }
     }
+finish:
 
     *got_frame      = 1;
     return avpkt->size;
 
     *got_frame      = 1;
     return avpkt->size;