mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
add missing ABI compatibility checks
original change:
f7f16a2
add ABI compatibility check
Change-Id: I7cd6508f8d8e0d957a3d62ad52a117876fa5ec29
This commit is contained in:
parent
9d45416aa7
commit
ce156afccf
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user