Skip to content

Commit

Permalink
Fix false positive -Wnull-dereference warning with gcc 13.1.1 of Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 5, 2023
1 parent b54ad56 commit a38fb95
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gcore/gdaljp2box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,11 @@ GDALJP2Box *GDALJP2Box::CreateJUMBFBox(const GDALJP2Box *poJUMBFDescriptionBox,
int nCount,
const GDALJP2Box *const *papoBoxes)
{
std::vector<const GDALJP2Box *> apoBoxes(1 + nCount);
apoBoxes[0] = poJUMBFDescriptionBox;
memcpy(&apoBoxes[1], papoBoxes, nCount * sizeof(GDALJP2Box *));
return CreateSuperBox("jumb", 1 + nCount, apoBoxes.data());
std::vector<const GDALJP2Box *> apoBoxes;
apoBoxes.push_back(poJUMBFDescriptionBox);
apoBoxes.insert(apoBoxes.end(), papoBoxes, papoBoxes + nCount);
return CreateSuperBox("jumb", static_cast<int>(apoBoxes.size()),
apoBoxes.data());
}

/*! @endcond */

0 comments on commit a38fb95

Please sign in to comment.