Parse 'auxl' and 'prem' within their own box size - #3324
Conversation
A follow-up to PR AOMediaCodec#3321. Delete the comments that describe the bugs that were fixed. Also move avifROStreamSkip(&s, irefHeader.size) and avifROStreamSkip(&s, groupHeader.size) calls to the end of the loops, which is the common convention in this file.
| } | ||
| } | ||
|
|
||
| AVIF_CHECKERR(avifROStreamSkip(&s, irefHeader.size), AVIF_RESULT_BMFF_PARSE_FAILED); |
There was a problem hiding this comment.
cc: @Nexory
I audited the entire src/read.c file and inspected all the avifROStreamReadBoxHeader() and avifROStreamReadBoxHeaderPartial() calls. Only avifTrackReferenceBox() needs work, see the changes below.
I deleted the comments that describe the bugs that were fixed. They can be confusing unless one looks at the old code.
|
Thanks for the follow-up and for auditing the whole file, @wantehchang. Both changes look correct to me. Moving the The And no objection to dropping the comments now that the bug is gone. |
Nexory
left a comment
There was a problem hiding this comment.
LGTM. I verified the skip move is behaviour-preserving and the auxl/prem size checks close the same underflow in the track reference box.
|
Nexory: Thank you for reviewing this PR. While auditing all the |
|
@wantehchang Thanks for the pointer, and for extending the iref fix to auxl/prem in this PR. I have finished the pass over Scope: read.c, stream.c and internal.h at 6868dd1. I checked the tmap items against a build; everything else below is from reading the code, and I flag which is which. How the loop is structured, as I understand it Three properties determine most of the behaviour, and three of my initial candidates died on them:
Observations I think are worth a follow up
Things I checked and consider intentional or benign, so they do not need action
Happy to send a patch plus a regression test for any of the six items you think is worth fixing, one at a time and in whatever order suits you. Items 1 and 3 are the smallest and I would start there if you have no preference. If you would rather close any of them as working as intended, that is a fine answer too and I will not re-raise it. |
A follow-up to PR #3321.
Delete the comments that describe the bugs that were fixed.
Also move avifROStreamSkip(&s, irefHeader.size) and avifROStreamSkip(&s, groupHeader.size) calls to the end of the loops, which is the common convention in this file.