diff --git a/examples/cwebp.c b/examples/cwebp.c index 61350b9d..ff8d3ea2 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -463,8 +463,9 @@ static int WriteWebPWithMetadata(FILE* const out, } else { const int is_lossless = !memcmp(webp, "VP8L", kTagSize); if (is_lossless) { - // Presence of alpha is stored in the 29th bit of VP8L data. - if (webp[kChunkHeaderSize + 3] & (1 << 5)) flags |= kAlphaFlag; + // Presence of alpha is stored in the 37th bit (29th after the + // signature) of VP8L data. + if (webp[kChunkHeaderSize + 4] & (1 << 4)) flags |= kAlphaFlag; } ok = ok && (fwrite(kVP8XHeader, kChunkHeaderSize, 1, out) == 1); ok = ok && WriteLE32(out, flags);