Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5954 closed defect (fixed)

VRT Simple Source fails when a source is an explicit overview band

Reported by: Lucian Plesea Owned by: warmerdam
Priority: normal Milestone: 1.11.3
Component: default Version: unspecified
Severity: normal Keywords:


When a VRT simple source band is explicitly created from a specific overview band and the content is read, the following occurs:

  • VRTDataset::CheckCompatibleForDatasetIO() returns TRUE
  • VRTSimpleSource::DatasetRasterIO() is called

But an overview band does not necessarily have a valid poDS field, in which case DatasetRasterIO returns failure with no error message.

Even if the overview has a valid pointer to the parent dataset, the RasterIO performed by the parent dataset does not necessarily use the overview band as the one used to create the VRT, contrary to the purpose of creating an VRT from a specific overview.

Proposed Fix: In addition to the current code: Return FALSE from CheckCompatibleForDatasetIO()

  • if any of the source bands don't have a valid parent dataset pointer
  • if any of the source bands are overviews

Both of these conditions are not compatible with DatasetIO.

Attachments (1)

vrtdataset.patch (930 bytes) - added by Lucian Plesea 6 years ago.
Even better test

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by Even Rouault

Could you attach a patch for this ?

comment:2 Changed 6 years ago by Lucian Plesea

Attaching patch against 1.11.2/frtms/vrt/vrtdataset.cpp

comment:3 Changed 6 years ago by Lucian Plesea

The check for overview is wrong in the patch, give me a bit of time!

Changed 6 years ago by Lucian Plesea

Attachment: vrtdataset.patch added

Even better test

comment:4 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: newclosed

trunk r29173, branches/1.11 r29174 "VRT: add more checks to CheckCompatibleForDatasetIO() to avoid issues with overview bands (patch by lplesea, #5954)"

comment:5 Changed 6 years ago by Even Rouault

trunk r29192, branches/1.11 r29193 "VRT: additional fix for #5954 to avoid new warnings by CheckCompatibleForDatasetIO()"

Note: See TracTickets for help on using tickets.