Skip to content

Commit c4d14db

Browse files
committed
Use HWY_ABORT instead of std::cerr for overflow checks in ReadPPM
1 parent e260706 commit c4d14db

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

paligemma/image.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ bool Image::ReadPPM(const hwy::Span<const char>& buf) {
140140
}
141141
++pos;
142142
if (width == 0 || height == 0) {
143-
std::cerr << "Invalid zero dimension\n";
143+
HWY_ABORT("Invalid zero dimension\n");
144144
return false;
145145
}
146146
if (width > SIZE_MAX / 3 || width * 3 > SIZE_MAX / height) {
147-
std::cerr << "Image dimensions overflow\n";
147+
HWY_ABORT("Image dimensions overflow\n");
148148
return false;
149149
}
150150
const size_t data_size = width * height * 3;

0 commit comments

Comments
 (0)