mirror of
https://github.com/django/django.git
synced 2025-09-20 01:10:35 +00:00
Refs #23804 -- Improved value validation in GDALRaster.geotransform setter.
This commit is contained in:
parent
037d6540ec
commit
9509268cea
2 changed files with 16 additions and 1 deletions
|
@ -250,7 +250,7 @@ class GDALRaster(GDALBase):
|
|||
@geotransform.setter
|
||||
def geotransform(self, values):
|
||||
"Set the geotransform for the data source."
|
||||
if sum([isinstance(x, (int, float)) for x in values]) != 6:
|
||||
if len(values) != 6 or not all(isinstance(x, (int, float)) for x in values):
|
||||
raise ValueError('Geotransform must consist of 6 numeric values.')
|
||||
# Create ctypes double array with input and write data
|
||||
values = (c_double * 6)(*values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue