Skip to content

Commit 9dd7351

Browse files
committed
SAR_CEOS: do not emit a debug message on Palsar2/3 products when inspecting their trailer file
1 parent 586707b commit 9dd7351

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

frmts/ceos2/sar_ceosdataset.cpp

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ GDALDataset *SAR_CEOSDataset::Open(GDALOpenInfo *poOpenInfo)
18341834
bIsALOS2Or4 && iFile == CEOS_TRAILER_FILE;
18351835
if (ProcessData(process_fp, iFile, psVolume, -1,
18361836
VSIFTellL(process_fp),
1837-
bSilentWrongRecordNumber) == 0)
1837+
bSilentWrongRecordNumber) == CE_None)
18381838
{
18391839
switch (iFile)
18401840
{
@@ -2129,27 +2129,21 @@ static int ProcessData(VSILFILE *fp, int fileid, CeosSARVolume_t *sar,
21292129
CPLFree(temp_body);
21302130
return CE_Warning;
21312131
}
2132+
else if (bSilentWrongRecordNumber && iThisRecord == 2)
2133+
{
2134+
CPLFree(record);
2135+
CPLFree(temp_body);
2136+
return CE_Warning;
2137+
}
21322138
else
21332139
{
2134-
if (bSilentWrongRecordNumber)
2135-
{
2136-
CPLDebug(
2137-
"SAR_CEOS",
2138-
"Corrupted CEOS File - got record seq# %d instead of "
2139-
"the expected %d.",
2140-
record->Sequence, iThisRecord);
2141-
}
2142-
else
2143-
{
2144-
CPLError(
2145-
CE_Warning, CPLE_AppDefined,
2146-
"Corrupted CEOS File - got record seq# %d instead of "
2147-
"the expected %d.",
2148-
record->Sequence, iThisRecord);
2149-
}
2140+
CPLError(CE_Warning, CPLE_AppDefined,
2141+
"Corrupted CEOS File - got record seq# %d instead of "
2142+
"the expected %d.",
2143+
record->Sequence, iThisRecord);
21502144
CPLFree(record);
21512145
CPLFree(temp_body);
2152-
return bSilentWrongRecordNumber ? CE_Warning : CE_Failure;
2146+
return CE_Failure;
21532147
}
21542148
}
21552149

0 commit comments

Comments
 (0)