-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avifMetaDestroy: check meta pointer before accessing #2065
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -760,6 +760,10 @@ static avifMeta * avifMetaCreate() | |
|
||
static void avifMetaDestroy(avifMeta * meta) | ||
{ | ||
if (meta == NULL) { | ||
return; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: The current style in src/read.c is to have the caller handle this. For example, see the second
So I suggest adding a similar null pointer check to the first
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done |
||
|
||
for (uint32_t i = 0; i < meta->items.count; ++i) { | ||
avifDecoderItem * item = meta->items.item[i]; | ||
avifArrayDestroy(&item->properties); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should also acknowledge the person who ran nallocfuzz and reported this bug to us (Philippe Antoine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the format I used in other projects, that was suggested by Philippe. I can add his name though.