Skip to content

Update 3rdparty zlib to 1.3#24717

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
FantasqueX:zlib-1-3
Dec 19, 2023
Merged

Update 3rdparty zlib to 1.3#24717
asmorkalov merged 1 commit intoopencv:4.xfrom
FantasqueX:zlib-1-3

Conversation

@FantasqueX
Copy link
Copy Markdown
Contributor

The opencv zlib patch is still not merged. So I applied it to zlib-1.3. Since zlib-1.3 didn't modify CMakeLists.txt, opencv's zlib CMakeLists.txt doesn't need to be modified.

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

The opencv zlib patch is still not merged. So I applied it to zlib-1.3.
Since zlib-1.3 didn't modify CMakeLists.txt, opencv's zlib
CMakeLists.txt doesn't need to be modified.
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

I compared your branch with official zlib 1.3 sources and see some difference in inflate.c.

@FantasqueX
Copy link
Copy Markdown
Contributor Author

@asmorkalov Hi, thanks for your review. I checked it again. The only difference between my branch and the official zlib-1.3 is

@@ -207,7 +207,6 @@
     state->strm = strm;
     state->window = Z_NULL;
     state->mode = HEAD;     /* to pass state test in inflateReset2() */
-    state->check = 1L;      /* 1L is the result of adler32() zero length data */
     ret = inflateReset2(strm, windowBits);
     if (ret != Z_OK) {
         ZFREE(strm, state);

As I mentioned above, "The opencv zlib patch is still not merged. So, I applied it to zlib-1.3.". you can check at https://github.com/opencv/opencv/blob/4.x/3rdparty/zlib/patches/20190330-ununitialized-use-state-check.diff

@asmorkalov
Copy link
Copy Markdown
Contributor

Ok, I got your point about the patch. It's not obvious from the PR description.

@asmorkalov
Copy link
Copy Markdown
Contributor

For reference: issue and patch information:

    3rdparty(zlib): prevent uninitialized use of state->check
    
    ozz-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13317
    PR: https://github.com/opencv/opencv/pull/14193
    zlib upstream bug: madler/zlib#245
    Ported fix: https://chromium.googlesource.com/chromium/src/+/ee376c65abdd5afe787bfb63af9f2e82fdc35c2e

Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalov asmorkalov added this to the 4.9.0 milestone Dec 19, 2023
@asmorkalov asmorkalov self-assigned this Dec 19, 2023
@asmorkalov
Copy link
Copy Markdown
Contributor

/cc @opencv-alalek @mshabunin

@asmorkalov asmorkalov merged commit f1d3341 into opencv:4.x Dec 19, 2023
@asmorkalov asmorkalov mentioned this pull request Jan 19, 2024
@FantasqueX FantasqueX deleted the zlib-1-3 branch June 28, 2024 13:08
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.

2 participants