Fix use of WebPGetFeatures's returned status

This commit is contained in:
Martín Capello 2024-10-10 10:21:41 -03:00
parent ac1024f5d3
commit 0bf62c4545

View File

@ -42,11 +42,10 @@ os::SurfaceRef decode_webp(const uint8_t* buf, uint32_t len)
WebPDecoderConfig config;
WebPInitDecoderConfig(&config);
if (WebPGetFeatures(webp_data.bytes, webp_data.size, &config.input)) {
}
else {
config.input.has_alpha = false;
auto status = WebPGetFeatures(webp_data.bytes, webp_data.size, &config.input);
if (status != VP8_STATUS_OK) {
// Error getting WebP features.
return nullptr;
}
const int w = anim_info.canvas_width;