Ticket #1481 (closed defect: fixed)
NG Swig Dataset ReadRaster() problems
| Reported by: | warmerdam | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.1 |
| Component: | PythonBindings | Version: | 1.4.0 |
| Severity: | major | Keywords: | |
| Cc: |
Description (last modified by hobu) (diff)
Reading rasters with Dataset.ReadRaster() with a multi-band band list
results in a crash due to improperly computing buf_size (failing to
multiple by band count).
Index: Dataset.i
===================================================================
--- Dataset.i (revision 10773)
+++ Dataset.i (working copy)
@@ -90,9 +90,7 @@
int *buf_size, char **buf,
int band_list, int *pband_list )
{
-
-
- *buf_size = buf_xsize * buf_ysize * GDALGetDataTypeSize( buf_type ) / 8;
+ *buf_size = buf_xsize * buf_ysize * (GDALGetDataTypeSize( buf_type ) / 8) * band_list;
*buf = (char*) malloc( *buf_size );
CPLErr result = GDALDatasetRasterIO(obj, GF_Read, xoff, yoff, xsize, ysize,
Change History
Note: See
TracTickets for help on using
tickets.
