Skip to content

Commit

Permalink
gdal_fuzzer: avoid false positive warning about div by zero (CID 1512…
Browse files Browse the repository at this point in the history
…809)
  • Loading branch information
rouault committed Jun 5, 2023
1 parent 92f9cee commit ec8f601
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzzers/gdal_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
if (hRawDS)
{
nSimultaneousBands = GDALGetRasterCount(hRawDS);
// shouldn't happen, but will make Coverity Scan happy
if (nSimultaneousBands == 0)
nSimultaneousBands = 1;
GDALClose(hRawDS);
}
}
Expand Down

0 comments on commit ec8f601

Please sign in to comment.