mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
ImageData: make sure that width and height are not 0
This commit is contained in:
@@ -58,6 +58,10 @@ pub fn constructor(
|
|||||||
maybe_settings: ?ConstructorSettings,
|
maybe_settings: ?ConstructorSettings,
|
||||||
page: *Page,
|
page: *Page,
|
||||||
) !*ImageData {
|
) !*ImageData {
|
||||||
|
if (width == 0 or height == 0) {
|
||||||
|
return error.IndexSizeError;
|
||||||
|
}
|
||||||
|
|
||||||
const settings: ConstructorSettings = maybe_settings orelse .{};
|
const settings: ConstructorSettings = maybe_settings orelse .{};
|
||||||
if (settings.colorSpace.eql(comptime .wrap("srgb")) == false) {
|
if (settings.colorSpace.eql(comptime .wrap("srgb")) == false) {
|
||||||
return error.TypeError;
|
return error.TypeError;
|
||||||
|
|||||||
Reference in New Issue
Block a user