Skip to content

Commit

Permalink
Check for error when calling ComputeImageSizeInBytes
Browse files Browse the repository at this point in the history
(cherry picked from commit f3244fe)

Bug: chromium:1304987
Change-Id: I8311231156fca3200ce74d79db59d910a1a0e33a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3556686
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#986304}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593849
Auto-Submit: Gregg Tavares <gman@chromium.org>
Reviewed-by: Ben Mason <benmason@chromium.org>
Commit-Queue: Ben Mason <benmason@chromium.org>
Owners-Override: Ben Mason <benmason@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/branch-heads/4951@{#902}
Cr-Branched-From: 27de622-refs/heads/main@{#982481}
  • Loading branch information
greggman authored and Krishna Govind committed Apr 19, 2022
1 parent b4f1a5f commit 96feac6
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -3996,8 +3996,10 @@ bool WebGLImageConversion::ExtractTextureData(
data.resize(width * height * bytes_per_pixel);

unsigned image_size_in_bytes, skip_size_in_bytes;
ComputeImageSizeInBytes(format, type, width, height, 1, unpack_params,
&image_size_in_bytes, nullptr, &skip_size_in_bytes);
if (ComputeImageSizeInBytes(format, type, width, height, 1, unpack_params,
&image_size_in_bytes, nullptr,
&skip_size_in_bytes) != GL_NO_ERROR)
return false;
const uint8_t* src_data = static_cast<const uint8_t*>(pixels);
if (skip_size_in_bytes) {
src_data += skip_size_in_bytes;
Expand Down

0 comments on commit 96feac6

Please sign in to comment.