Skip to content

Fix oss-fuzz bugs 391934081 and 392318892#26854

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
vrabaud:png_leak
Jan 31, 2025
Merged

Fix oss-fuzz bugs 391934081 and 392318892#26854
asmorkalov merged 2 commits intoopencv:4.xfrom
vrabaud:png_leak

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Jan 29, 2025

  • fix a potential overflow in x0+w0
  • use the proper function to deal with background color to deal with all cases of the spec
  • use BGR layout for APNG background color

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov self-assigned this Jan 29, 2025
@asmorkalov asmorkalov added this to the 4.12.0 milestone Jan 29, 2025
@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Jan 29, 2025

I also switched the alpha to no be transparent: it does not matter anyway as it is not included in the spec (it is a background color) but we might as well have the color be usable.

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Jan 29, 2025

Actually, I switched back to having alpha == 0: this is more consistent with the cv::Scalar API

- fix a potential overflow in x0+w0
- use the proper function to deal with background color to deal
  with all cases of the spec
@asmorkalov asmorkalov merged commit c21d0ad into opencv:4.x Jan 31, 2025
29 of 30 checks passed
@asmorkalov asmorkalov mentioned this pull request Feb 19, 2025
NanQin555 pushed a commit to NanQin555/opencv that referenced this pull request Feb 24, 2025
Fix oss-fuzz bugs 391934081 and 392318892 opencv#26854

- fix a potential overflow in x0+w0
- use the proper function to deal with background color to deal with all cases of the spec
- use BGR layout for APNG background color

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants