Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Conversation

Shivam7-1
Copy link
Contributor

To address the potential overflow issue in the multiplication of w * h * (bit16 ? 8 : 4) and casting it to size_t, I had perform the multiplication using size_t directly to avoid the overflow.
patch link: https://issuetracker.google.com/issues/322327444

Code modification ensures that the multiplication is done using the larger integer type (size_t) before casting the result to unsigned char*. Using size_t for the multiplication helps prevent overflow issues, as size_t is typically large enough to accommodate the size of memory in the system.

@Shivam7-1
Copy link
Contributor Author

Hi @lvandeve Could You Please Review Above PR

Thanks & Regards

@Shivam7-1
Copy link
Contributor Author

Hi @enh-google Could You Please Review Above PR

Thanks & Regards

@enh-google
Copy link
Contributor

(i only maintain Android's copy of this code, and we only use this file on the host, where we don't enable intsan anyway. i've forwarded this -- and the bug -- to the real zopfli maintainers internally though.)

@Shivam7-1
Copy link
Contributor Author

Hi @enh-google Okay Thanks 👍

@Shivam7-1
Copy link
Contributor Author

Hi @lvandeve Could You Please Review Above PR

Thanks & Regards

@lvandeve
Copy link
Contributor

I pulled #198 which does the same, so this now has a conflict. Does #198 solve it?

@Shivam7-1
Copy link
Contributor Author

I pulled #198 which does the same, so this now has a conflict. Does #198 solve it?
Hi
Yes You are Right both are same
My mistake
Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants