Skip to content
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

Fix memcpy/sizeof typo in avifImageCopy #483

Merged

Conversation

fdintino
Copy link
Contributor

I stumbled across this typo while trying to debug i686 CI failures for python-pillow/Pillow#5201.

sizeof(dstImage->pasp) is 8, but sizeof(dstImage->imir) is 1. On 32-bit architectures that meant that the avifImage->exif pointer was fully copied to dstImage. This resulted in a double free abort, because both avifEncoderDataDestroy and avifImageDestroy were doing a free of the same location in memory (of encoder->data->metadataImage->exif and image->exif, respectively).

Copy link
Collaborator

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice catch. Thanks a lot for the fix!

Joe: We should switch to struct assignment to avoid this class of bug.

@wantehchang wantehchang merged commit e86e59f into AOMediaCodec:master Jan 30, 2021
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.

None yet

2 participants