mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
1 parent
f1a9d34494
commit
3bad76cd2c
2 files changed
+18
-8
No files matched your search
@@ -650,15 +650,20 @@ wuffs_base__pixel_config__set(wuffs_base__pixel_config* c,
|
||||
return;
|
||||
}
|
||||
if (pixfmt_repr) {
|
||||
uint64_t wh = ((uint64_t)width) * ((uint64_t)height);
|
||||
// TODO: handle things other than 1 byte per pixel.
|
||||
if (wh <= ((uint64_t)SIZE_MAX)) {
|
||||
do {
|
||||
#if SIZE_MAX < UINT64_MAX
|
||||
uint64_t wh = ((uint64_t)width) * ((uint64_t)height);
|
||||
// TODO: handle things other than 1 byte per pixel.
|
||||
if (wh > ((uint64_t)SIZE_MAX)) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
c->private_impl.pixfmt.repr = pixfmt_repr;
|
||||
c->private_impl.pixsub.repr = pixsub_repr;
|
||||
c->private_impl.width = width;
|
||||
c->private_impl.height = height;
|
||||
return;
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
|
||||
c->private_impl.pixfmt.repr = 0;
|
||||
|
||||
@@ -4598,15 +4598,20 @@ wuffs_base__pixel_config__set(wuffs_base__pixel_config* c,
|
||||
return;
|
||||
}
|
||||
if (pixfmt_repr) {
|
||||
uint64_t wh = ((uint64_t)width) * ((uint64_t)height);
|
||||
// TODO: handle things other than 1 byte per pixel.
|
||||
if (wh <= ((uint64_t)SIZE_MAX)) {
|
||||
do {
|
||||
#if SIZE_MAX < UINT64_MAX
|
||||
uint64_t wh = ((uint64_t)width) * ((uint64_t)height);
|
||||
// TODO: handle things other than 1 byte per pixel.
|
||||
if (wh > ((uint64_t)SIZE_MAX)) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
c->private_impl.pixfmt.repr = pixfmt_repr;
|
||||
c->private_impl.pixsub.repr = pixsub_repr;
|
||||
c->private_impl.width = width;
|
||||
c->private_impl.height = height;
|
||||
return;
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
|
||||
c->private_impl.pixfmt.repr = 0;
|
||||
|
||||
Reference in new issue
Block a user