From 93f671d795bf91d895f3046e55ac9c93e51d2fab Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Tue, 19 May 2026 13:41:26 -0700 Subject: [PATCH] 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. --- app/assets/services/ingest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/services/ingest.py b/app/assets/services/ingest.py index 5716f3d5b..3b6dc237c 100644 --- a/app/assets/services/ingest.py +++ b/app/assets/services/ingest.py @@ -414,8 +414,8 @@ def _backfill_image_dimensions_from_siblings( width = meta.get("width") height = meta.get("height") if ( - not isinstance(width, int) - or not isinstance(height, int) + type(width) is not int + or type(height) is not int or width <= 0 or height <= 0 ):