[gdal-dev] GDAL 3.4.2: gdalbuildvrt band selection bug

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Wed Mar 30 04:29:48 PDT 2022


Hi,

I can confirm with GDAL 3.5.0dev from gisinternals and with a normal RGB ortoimage.

gdalbuildvrt test.vrt p4433h.tif -b 2
0...10...20...30...40...50...60...70...80...90...100 - done.
ERROR 5: p4433h.tif: GDALDataset::GetRasterBand(2) - Illegal band #

With -b 1 -b 2 the command runs fine.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Pete Bunting via gdal-dev
Lähetetty: keskiviikko 30. maaliskuuta 2022 13.59
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: [gdal-dev] GDAL 3.4.2: gdalbuildvrt band selection bug

Hi, 

With the release of gdal 3.4.2, gdalbuildvrt seems to have a bug when selecting image bands. It works OK when band 1 is specified but if other band(s) in the image are used without band 1 then it seg faults. I noticed there were some changes around checking bands in the release notes "change logic to check homogenous number of bands” and I had a quick look at the commits but cannot see where this is occurring. 

# Works:
gdalbuildvrt test.vrt sen2_20210527_aber_subset.kea -b 1

# Seg Faults:
gdalbuildvrt test.vrt sen2_20210527_aber_subset.kea -b 2

ERROR 5: sen2_20210527_aber_subset.kea: GDALDataset::GetRasterBand(2) - Illegal band # Segmentation fault (core dumped)


# Works:
gdalbuildvrt test.vrt sen2_20210527_aber_subset.kea -b 1 -b 2 -b 3

# Seg Faults:
gdalbuildvrt test.vrt sen2_20210527_aber_subset.kea -b 2 -b 3 -b 4

ERROR 5: sen2_20210527_aber_subset.kea: GDALDataset::GetRasterBand(4) - Illegal band # Segmentation fault (core dumped)

Note, the input image I was using has 10 bands and these commands work with 3.4.1. I get the same seg fault on Mac, Linux and Windows ("Windows fatal exception: access violation"). 

Many thanks, 

Pete
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list