Skip to content

Check the return value of avifDecoderSetIOMemory.#24438

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:avif_check
Oct 24, 2023
Merged

Check the return value of avifDecoderSetIOMemory.#24438
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:avif_check

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Oct 23, 2023

The API will soon be made no_discard.

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

The API will soon be made no_discard.
@asmorkalov asmorkalov self-requested a review October 23, 2023 14:35
@asmorkalov asmorkalov self-assigned this Oct 23, 2023
@asmorkalov
Copy link
Copy Markdown
Contributor

The API will soon be made no_discard.
What version do you mean?

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Oct 23, 2023

The next version will have it. no_discard just triggers a warning. If users have -Werror, they should have -i system anyway to not trigger warnings from dependency headers.

@opencv-alalek opencv-alalek added this to the 4.9.0 milestone Oct 23, 2023
@asmorkalov asmorkalov merged commit 3429c27 into opencv:4.x Oct 24, 2023
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.

👍

decoder);
decoder->io->sizeHint = 1e9;
const avifResult status = avifDecoderParse(decoder);
avifDecoderDestroy(decoder);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Won't decoder instance leak if we exit earlier due to failed avifDecoderSetIOMemory call?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are totally right, I provided a fix in #24441. Thx !

@vrabaud vrabaud deleted the avif_check branch October 24, 2023 07:44
@asmorkalov asmorkalov mentioned this pull request Nov 3, 2023
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.

4 participants