Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 577114064
Change-Id: I62d81773b9a3105df7df86b904ea9dba5d90d593
  • Loading branch information
vrabaud authored and copybara-github committed Oct 27, 2023
1 parent bdad388 commit 779d05d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tensorstore/internal/image/webp_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ absl::Status WebPReader::Context::Init() {
absl::Status WebPReader::Context::Decode(tensorstore::span<unsigned char> dest,
const WebPReaderOptions& options) {
WebPDecBuffer buf;
WebPInitDecBuffer(&buf);
if (!WebPInitDecBuffer(&buf)) {
return absl::InternalError("Failed to init WEBP decoder buffer");
}
buf.colorspace = features_.has_alpha ? MODE_RGBA : MODE_RGB;
buf.u.RGBA.rgba = dest.data();
buf.u.RGBA.stride = features_.width * (features_.has_alpha ? 4 : 3);
Expand Down
4 changes: 3 additions & 1 deletion tensorstore/internal/image/webp_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ absl::Status EncodeWebP(riegeli::Writer* writer,
ABSL_CHECK(WebPValidateConfig(&config));

WebPPicture pic;
WebPPictureInit(&pic);
if (!WebPPictureInit(&pic)) {
return absl::InternalError("WEBP picture init failed");
}
pic.width = info.width;
pic.height = info.height;
pic.writer = WebPWriterWrite;
Expand Down

0 comments on commit 779d05d

Please sign in to comment.