diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index bf138b2a44..df3380ddda 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -226,6 +226,8 @@ static int decode_frame(AVCodecContext *avctx, 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); } @@ -246,6 +248,7 @@ static int decode_frame(AVCodecContext *avctx, y--; } } +finish: *got_frame = 1; return avpkt->size;