# HG changeset patch # User Matti Hamalainen # Date 1525982870 -10800 # Node ID a988baa5b21ffe063902ae8a048c3846b6020c95 # Parent 499835ba215c674a0df2e478ab73b32f1ef2dbf7 Add stub function to prevent attempts to encode formats that do not support encoding yet. diff -r 499835ba215c -r a988baa5b21f tools/lib64gfx.c --- a/tools/lib64gfx.c Thu May 10 22:30:36 2018 +0300 +++ b/tools/lib64gfx.c Thu May 10 23:07:50 2018 +0300 @@ -586,6 +586,18 @@ } +static int fmtEncodeStub(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) +{ + (void) buf; + (void) img; + (void) fmt; + + return dmError(DMERR_NOT_SUPPORTED, + "Encoding of '%s' format not supported.\n", + fmt->name); +} + + static Uint8 fmtGetPixelFunPaint2( const DMC64Image *img, const int bmoffs, const int scroffs, const int vshift, const int vbitmap, const int raster) @@ -698,7 +710,7 @@ C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, fmtProbeDrazPaint20Packed, - fmtDecodeDrazPaintPacked, NULL, + fmtDecodeDrazPaintPacked, fmtEncodeStub, NULL, NULL, NULL, { @@ -715,7 +727,7 @@ C64_SCR_WIDTH , C64_SCR_HEIGHT, C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, fmtProbeDrazLace10Packed, - fmtDecodeDrazPaintPacked, NULL, + fmtDecodeDrazPaintPacked, fmtEncodeStub, NULL, NULL, NULL, { @@ -824,7 +836,7 @@ C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, fmtProbeAmicaPaintPacked, - fmtDecodeAmicaPaintPacked, NULL, + fmtDecodeAmicaPaintPacked, fmtEncodeStub, NULL, NULL, NULL, { @@ -992,7 +1004,7 @@ C64_SCR_WIDTH, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, fmtProbeFunPaint2Unpacked, - fmtDecodeFunPaint2Unpacked, NULL, + fmtDecodeFunPaint2Unpacked, fmtEncodeStub, NULL, NULL, fmtGetPixelFunPaint2, { @@ -1012,7 +1024,7 @@ C64_SCR_WIDTH, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, fmtProbeFunPaint2Packed, - fmtDecodeFunPaint2Packed, NULL, + fmtDecodeFunPaint2Packed, fmtEncodeStub, NULL, NULL, fmtGetPixelFunPaint2, {