Fix MSVC warning about assignment in condition

This commit is contained in:
Even Rouault 2024-12-08 21:57:41 +01:00
parent f1911cfccc
commit 07ea15fe9e
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
1 changed files with 8 additions and 6 deletions

View File

@ -4714,16 +4714,18 @@ static GDALDatasetH GDALWarpCreateOutput(
aosCreateOptions.SetNameValue("PHOTOMETRIC", "RGB");
// Preserve potential ALPHA=PREMULTIPLIED from source alpha band
const char *pszAlpha;
if (aosCreateOptions.FetchNameValue("ALPHA") == nullptr &&
apeColorInterpretations.size() == 4 &&
apeColorInterpretations[3] == GCI_AlphaBand &&
GDALGetRasterCount(pahSrcDS[0]) == 4 &&
(pszAlpha =
GDALGetMetadataItem(GDALGetRasterBand(pahSrcDS[0], 4),
"ALPHA", "IMAGE_STRUCTURE")))
GDALGetRasterCount(pahSrcDS[0]) == 4)
{
aosCreateOptions.SetNameValue("ALPHA", pszAlpha);
const char *pszAlpha =
GDALGetMetadataItem(GDALGetRasterBand(pahSrcDS[0], 4),
"ALPHA", "IMAGE_STRUCTURE");
if (pszAlpha)
{
aosCreateOptions.SetNameValue("ALPHA", pszAlpha);
}
}
}