Skip to content

Commit

Permalink
JPGDataset::CreateCopy(): fix potential crash recently introduced (ma…
Browse files Browse the repository at this point in the history
…ster only)
  • Loading branch information
rouault committed Jan 2, 2023
1 parent df9c728 commit 30daf01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frmts/jpeg/jpgdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3889,7 +3889,8 @@ GDALDataset *JPGDataset::CreateCopy(const char *pszFilename,

// Try to convert losslessly from JPEGXL
auto poUnderlyingSrcDS = GetUnderlyingDataset(poSrcDS);
if (poUnderlyingSrcDS->GetDriver() != nullptr &&
if (poUnderlyingSrcDS != nullptr &&
poUnderlyingSrcDS->GetDriver() != nullptr &&
EQUAL(poUnderlyingSrcDS->GetDriver()->GetDescription(), "JPEGXL") &&
CSLFetchNameValue(papszOptions, "QUALITY") == nullptr)
{
Expand Down

0 comments on commit 30daf01

Please sign in to comment.