Index: qgsrasterlayer.cpp =================================================================== --- qgsrasterlayer.cpp (révision 8647) +++ qgsrasterlayer.cpp (copie de travail) @@ -421,6 +421,18 @@ //check f this file has pyramids GDALRasterBandH myGDALBand = GDALGetRasterBand( mGdalDataset, 1 ); //just use the first band + if (myGDALBand == NULL) + { + // the dataset is probably a raster with subdatasets + // It would be good to support subdatasets + GDALDereferenceDataset(mGdalBaseDataset); + mGdalBaseDataset = NULL; + + GDALClose(mGdalDataset); + mGdalDataset = NULL; + mValid = FALSE; + return false; + } if( GDALGetOverviewCount(myGDALBand) > 0 ) { hasPyramidsFlag=true;