Merge "cwebp: fix WebPPictureHasTransparency call" into main

This commit is contained in:
James Zern 2022-08-11 16:55:40 +00:00 committed by Gerrit Code Review
commit 5000de5435

View File

@ -1140,9 +1140,10 @@ int main(int argc, const char* argv[]) {
}
picture.use_argb = 1;
if (!ReadWebP(memory_writer.mem, memory_writer.size, &picture,
/*keep_alpha=*/WebPPictureHasTransparency(&picture),
/*metadata=*/NULL)) {
if (!ReadWebP(
memory_writer.mem, memory_writer.size, &picture,
/*keep_alpha=*/WebPPictureHasTransparency(&original_picture),
/*metadata=*/NULL)) {
fprintf(stderr, "Error! Cannot decode encoded WebP bitstream\n");
fprintf(stderr, "Error code: %d (%s)\n", picture.error_code,
kErrorMessages[picture.error_code]);