You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
geotiff: malformed VRT SrcRect is swallowed by the lenient source-read fallback #1784
read_vrt() in xrspatial/geotiff/_vrt.py validates DstRect for negative sizes at lines 637-648 (issue #1737), but never validates SrcRect. A SimpleSource with <SrcRect xOff="0" yOff="0" xSize="-100" ySize="-100"/> reaches the source-read path and produces a ValueError inside read_to_array() when the window goes negative.
That ValueError is then caught by the broad source-read fallback at lines 738-746:
The fallback's purpose is to keep going when a referenced tile is missing or unreadable. Malformed XML is a different failure -- the file is present, the rectangle is just nonsense -- but the lenient path can't tell the two apart and treats both as "skip and warn." The result is a hole in the mosaic plus a confusing warning that mentions a window the caller never asked for.
Negative SrcRect offsets and offsets that fall outside the source raster have the same problem.
Expected behavior
Reject negative SrcRect sizes and negative offsets up-front, mirroring the DstRect check at line 643. The malformed-XML failure should always reach the caller, regardless of strict mode, with a typed ValueError that names the bad field.
Categories
Cat 3 (input validation): negative SrcRect dimensions not validated
Cat 4 (error handling): malformed XML masquerades as a missing-tile warning
Activity
geotiff: validate VRT SrcRect dimensions and offsets (#1784) (#1788)
geotiff: default _vrt.read_vrt missing_sources to 'raise' (#1843) (#1850