Merge "WebPPictureHasTransparency: add missing pointer check" into main

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

View File

@ -70,10 +70,13 @@ int WebPPictureHasTransparency(const WebPPicture* picture) {
if (picture == NULL) return 0; if (picture == NULL) return 0;
if (picture->use_argb) { if (picture->use_argb) {
const int alpha_offset = ALPHA_OFFSET; const int alpha_offset = ALPHA_OFFSET;
if (picture->argb != NULL) {
return CheckNonOpaque((const uint8_t*)picture->argb + alpha_offset, return CheckNonOpaque((const uint8_t*)picture->argb + alpha_offset,
picture->width, picture->height, picture->width, picture->height,
4, picture->argb_stride * sizeof(*picture->argb)); 4, picture->argb_stride * sizeof(*picture->argb));
} }
return 0;
}
return CheckNonOpaque(picture->a, picture->width, picture->height, return CheckNonOpaque(picture->a, picture->width, picture->height,
1, picture->a_stride); 1, picture->a_stride);
} }