diff options
Diffstat (limited to 'src/3rdparty/libwebp/src/dec/buffer.c')
-rw-r--r-- | src/3rdparty/libwebp/src/dec/buffer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/3rdparty/libwebp/src/dec/buffer.c b/src/3rdparty/libwebp/src/dec/buffer.c index 2129312..9ed2b3f 100644 --- a/src/3rdparty/libwebp/src/dec/buffer.c +++ b/src/3rdparty/libwebp/src/dec/buffer.c @@ -189,11 +189,14 @@ VP8StatusCode WebPAllocateDecBuffer(int w, int h, h = ch; } if (options->use_scaling) { - if (options->scaled_width <= 0 || options->scaled_height <= 0) { + int scaled_width = options->scaled_width; + int scaled_height = options->scaled_height; + if (!WebPRescalerGetScaledDimensions( + w, h, &scaled_width, &scaled_height)) { return VP8_STATUS_INVALID_PARAM; } - w = options->scaled_width; - h = options->scaled_height; + w = scaled_width; + h = scaled_height; } } out->width = w; @@ -203,12 +206,10 @@ VP8StatusCode WebPAllocateDecBuffer(int w, int h, status = AllocateBuffer(out); if (status != VP8_STATUS_OK) return status; -#if WEBP_DECODER_ABI_VERSION > 0x0203 // Use the stride trick if vertical flip is needed. if (options != NULL && options->flip) { status = WebPFlipBuffer(out); } -#endif return status; } |