mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
[core:image/png] use .Image_Dimensions_Too_Large
This commit is contained in:
@@ -250,10 +250,14 @@ read_header :: proc(ctx: ^$C) -> (image.PNG_IHDR, Error) {
|
|||||||
header := (^image.PNG_IHDR)(raw_data(c.data))^
|
header := (^image.PNG_IHDR)(raw_data(c.data))^
|
||||||
// Validate IHDR
|
// Validate IHDR
|
||||||
using header
|
using header
|
||||||
if width == 0 || height == 0 || u128(width) * u128(height) > image.MAX_DIMENSIONS {
|
if width == 0 || height == 0 {
|
||||||
return {}, .Invalid_Image_Dimensions
|
return {}, .Invalid_Image_Dimensions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if u128(width) * u128(height) > image.MAX_DIMENSIONS {
|
||||||
|
return {}, .Image_Dimensions_Too_Large
|
||||||
|
}
|
||||||
|
|
||||||
if compression_method != 0 {
|
if compression_method != 0 {
|
||||||
return {}, compress.General_Error.Unknown_Compression_Method
|
return {}, compress.General_Error.Unknown_Compression_Method
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user