diff --git a/src/dec/buffer.c b/src/dec/buffer.c index d0f7c82e..e8421785 100644 --- a/src/dec/buffer.c +++ b/src/dec/buffer.c @@ -167,7 +167,9 @@ VP8StatusCode WebPAllocateDecBuffer(int w, int h, // constructors / destructors int WebPInitDecBufferInternal(WebPDecBuffer* buffer, int version) { - if (version != WEBP_DECODER_ABI_VERSION) return 0; // version mismatch + if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { + return 0; // version mismatch + } if (buffer == NULL) return 0; memset(buffer, 0, sizeof(*buffer)); return 1; diff --git a/src/enc/config.c b/src/enc/config.c index a70eb0b2..fa11e89a 100644 --- a/src/enc/config.c +++ b/src/enc/config.c @@ -21,7 +21,7 @@ extern "C" { int WebPConfigInitInternal(WebPConfig* config, WebPPreset preset, float quality, int version) { - if (version != WEBP_ENCODER_ABI_VERSION) { + if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { return 0; // caller/system version mismatch! } if (config == NULL) return 0; diff --git a/src/enc/webpenc.c b/src/enc/webpenc.c index d36e8944..99ab170b 100644 --- a/src/enc/webpenc.c +++ b/src/enc/webpenc.c @@ -47,7 +47,7 @@ static int DummyWriter(const uint8_t* data, size_t data_size, } int WebPPictureInitInternal(WebPPicture* picture, int version) { - if (version != WEBP_ENCODER_ABI_VERSION) { + if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { return 0; // caller/system version mismatch! } if (picture != NULL) {