diff --git a/cmdutils.c b/cmdutils.c index dc7e7b2e65..9aec9ae5ae 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1566,7 +1566,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu /* XXX this shouldn't be needed, but some tests break without this line * those decoders are buggy and need to be fixed. * the following tests fail: - * cdgraphics, ansi, aasc, fraps-v1, qtrle-1bit + * ansi, aasc, fraps-v1, qtrle-1bit */ memset(buf->base[0], 128, ret); diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index e4ed83b9d4..9f402cae21 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -287,6 +287,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } + if (!avctx->frame_number) + memset(cc->frame.data[0], 0, cc->frame.linesize[0] * avctx->height); command = bytestream_get_byte(&buf); inst = bytestream_get_byte(&buf); diff --git a/tests/ref/fate/cdgraphics b/tests/ref/fate/cdgraphics index 78a8f28880..dccb2b5c36 100644 --- a/tests/ref/fate/cdgraphics +++ b/tests/ref/fate/cdgraphics @@ -1,20 +1,20 @@ #tb 0: 1/300 -0, 0, 0, 1, 194400, 0xd919c635 -0, 1, 1, 1, 194400, 0xd919c635 -0, 2, 2, 1, 194400, 0x516a1007 -0, 3, 3, 1, 194400, 0x516a1007 -0, 4, 4, 1, 194400, 0x516a1007 -0, 5, 5, 1, 194400, 0x516a1007 -0, 6, 6, 1, 194400, 0x516a1007 -0, 7, 7, 1, 194400, 0x516a1007 -0, 8, 8, 1, 194400, 0x516a1007 -0, 9, 9, 1, 194400, 0x516a1007 -0, 10, 10, 1, 194400, 0x516a1007 -0, 11, 11, 1, 194400, 0x516a1007 -0, 12, 12, 1, 194400, 0x516a1007 -0, 13, 13, 1, 194400, 0x516a1007 -0, 14, 14, 1, 194400, 0x516a1007 -0, 15, 15, 1, 194400, 0x516a1007 +0, 0, 0, 1, 194400, 0x46ad80da +0, 1, 1, 1, 194400, 0x46ad80da +0, 2, 2, 1, 194400, 0x9392c3b9 +0, 3, 3, 1, 194400, 0x9392c3b9 +0, 4, 4, 1, 194400, 0x9392c3b9 +0, 5, 5, 1, 194400, 0x9392c3b9 +0, 6, 6, 1, 194400, 0x9392c3b9 +0, 7, 7, 1, 194400, 0x9392c3b9 +0, 8, 8, 1, 194400, 0x9392c3b9 +0, 9, 9, 1, 194400, 0x9392c3b9 +0, 10, 10, 1, 194400, 0x9392c3b9 +0, 11, 11, 1, 194400, 0x9392c3b9 +0, 12, 12, 1, 194400, 0x9392c3b9 +0, 13, 13, 1, 194400, 0x9392c3b9 +0, 14, 14, 1, 194400, 0x9392c3b9 +0, 15, 15, 1, 194400, 0x9392c3b9 0, 16, 16, 1, 194400, 0x46ad80da 0, 17, 17, 1, 194400, 0x46ad80da 0, 18, 18, 1, 194400, 0x46ad80da