Skip to content

enforce minimum FileTypeBox length in Jp2Image::printStructure (backport #9318)#9351

Open
mergify[bot] wants to merge 1 commit into
0.28.xfrom
mergify/bp/0.28.x/pr-9318
Open

enforce minimum FileTypeBox length in Jp2Image::printStructure (backport #9318)#9351
mergify[bot] wants to merge 1 commit into
0.28.xfrom
mergify/bp/0.28.x/pr-9318

Conversation

@mergify

@mergify mergify Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

exiv2 -pS on a JP2 whose FileTypeBox sets its length below the 8-byte box header:

   12 |        2 | ftyp      | Uncaught exception: vector

box.length - boxHSize underflows, so Blob is sized to near SIZE_MAX and std::vector throws std::length_error rather than an Exiv2::Error. The sibling sub-box and uuid cases already guard length; this adds the same check before the FileTypeBox allocation.


This is an automatic backport of pull request #9318 done by [Mergify](https://mergify.com).

@mergify

mergify Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 9d31d6d has failed:

On branch mergify/bp/0.28.x/pr-9318
Your branch is up to date with 'origin/0.28.x'.

You are currently cherry-picking commit 9d31d6d4.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/jp2image.cpp

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants