fix(assets): reject booleans in sibling dimension validation (use type-is)

Per CodeRabbit follow-up on #13991: bool is a subclass of int in Python,
so isinstance(True, int) is True. The previous strict-int gate would
have accepted width=True (truthy + > 0) as a valid dimension.
Realistic occurrence is low (extract_image_dimensions returns proper
ints, JSON doesn't serialize bools as numbers), but the validation gate
exists for defense-in-depth so it should be actually strict.
This commit is contained in:
Matt Miller 2026-05-19 13:41:26 -07:00
parent f2c7330800
commit 93f671d795

View File

@ -414,8 +414,8 @@ def _backfill_image_dimensions_from_siblings(
width = meta.get("width") width = meta.get("width")
height = meta.get("height") height = meta.get("height")
if ( if (
not isinstance(width, int) type(width) is not int
or not isinstance(height, int) or type(height) is not int
or width <= 0 or width <= 0
or height <= 0 or height <= 0
): ):