Skip to content

Commit 178d2bc

Browse files
committed
picture_enc: remove dead dimension checks
WebPPictureAllocYUVA(): WebPValidatePicture() 15 lines above already rejects a non-positive width or height, and uv_* are (w + 1) / 2 and (h + 1) / 2. => dead, and sitting *after* the arithmetic they look like they guard. Change-Id: Ib05f56cced5dac363c6ba036bbdec3c3bf9adbac
1 parent 35d6fe0 commit 178d2bc

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

src/enc/picture_enc.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ int WebPPictureAllocYUVA(WebPPicture* const picture) {
127127

128128
total_size = y_size + a_size + 2 * uv_size;
129129

130-
// Security and validation checks
131-
if (width <= 0 || height <= 0 || // luma/alpha param error
132-
uv_width <= 0 || uv_height <= 0) { // u/v param error
133-
return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION);
134-
}
135130
// allocate a new buffer.
136131
mem = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*mem));
137132
if (mem == NULL) {

0 commit comments

Comments
 (0)