]> git.sesse.net Git - ffmpeg/commitdiff
cdgraphics: do not rely on get_buffer() initializing the frame.
authorAnton Khirnov <anton@khirnov.net>
Sat, 26 Jan 2013 21:02:19 +0000 (22:02 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 6 Feb 2013 09:21:52 +0000 (10:21 +0100)
Setting it to zero (instead of 128, as the default get_buffer() does)
also produces more correctly-looking output.

cmdutils.c
libavcodec/cdgraphics.c
tests/ref/fate/cdgraphics

index dc7e7b2e654ce33b28e79247de4cd70e0c53e7ec..9aec9ae5ae017b499ca38b9a24a1f93feee55ac4 100644 (file)
@@ -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);
 
index e4ed83b9d40f086d0991ccea28b1f81bcd434246..9f402cae217c07dfc1c46d106f00d57862e02525 100644 (file)
@@ -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);
index 78a8f288805bec95b0c23b171b99cee726a2d589..dccb2b5c3661089553f94c845b58c5dc72832050 100644 (file)
@@ -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