cdgraphics: do not rely on get_buffer() initializing the frame.

Setting it to zero (instead of 128, as the default get_buffer() does)
also produces more correctly-looking output.
pull/9/head
Anton Khirnov 12 years ago
parent 6ed9fc44ba
commit 238614de67
  1. 2
      cmdutils.c
  2. 2
      libavcodec/cdgraphics.c
  3. 32
      tests/ref/fate/cdgraphics

@ -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);

@ -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);

@ -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

Loading…
Cancel
Save