# HG changeset patch # User Matti Hamalainen # Date 1527189923 -10800 # Node ID 00e0d345e7f19940c96eb53c2407bee01689552f # Parent f31b77416a8342cc8f91be29638505022bf52bf4 Improve autoprobing error handling a bit. diff -r f31b77416a83 -r 00e0d345e7f1 tools/gfxconv.c --- a/tools/gfxconv.c Thu May 24 22:19:35 2018 +0300 +++ b/tools/gfxconv.c Thu May 24 22:25:23 2018 +0300 @@ -1700,16 +1700,15 @@ } res = dmC64DecodeBMP(&inC64Image, dataBuf, dataSize, optInSkip, optInSkip + 2, &inC64Fmt, forced); - if (forced == NULL && inC64Fmt != NULL) + if (forced == NULL && inC64Fmt != NULL && res == DMERR_OK) { dmMsg(1, "Probed '%s' format image, type %d, %s\n", inC64Fmt->name, inC64Fmt->type, inC64Fmt->fext); + + optInFormat = FFMT_BITMAP; } - - if (res == DMERR_OK) - optInFormat = FFMT_BITMAP; else - if (optInFormat == FFMT_BITMAP) + if (res != DMERR_OK && (forced != NULL || optInFormat == FFMT_BITMAP)) { dmErrorMsg("Could not decode input image: %s.\n", dmErrorStr(res)); goto error;