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

Check if the metadata is NULL #2665

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

kevinbackhouse
Copy link
Collaborator

Fixes: #2638, #2649

@kevinbackhouse
Copy link
Collaborator Author

I've converted this to draft because I'd like to merge #2664 first.

@kevinbackhouse
Copy link
Collaborator Author

@Mergifyio backport 0.28.x

@mergify
Copy link
Contributor

mergify bot commented Jun 25, 2023

backport 0.28.x

✅ Backports have been created

@ghost
Copy link

ghost commented Jun 25, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@codecov
Copy link

codecov bot commented Jun 25, 2023

Codecov Report

Merging #2665 (1119a68) into main (6b186a4) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main    #2665   +/-   ##
=======================================
  Coverage   63.92%   63.92%           
=======================================
  Files         103      103           
  Lines       22306    22306           
  Branches    10795    10795           
=======================================
  Hits        14259    14259           
  Misses       5826     5826           
  Partials     2221     2221           
Impacted Files Coverage Δ
src/nikonmn_int.cpp 61.20% <0.00%> (ø)
src/sonymn_int.cpp 79.90% <0.00%> (ø)

Copy link
Collaborator

@postscript-dev postscript-dev left a comment

Choose a reason for hiding this comment

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

@kevinbackhouse
Thanks for creating this PR. I started to look at this but your work saves me some time!

I reviewed all the tags and, as far as I could see, the only guards needed were in src/nikonmn_int.cpp and src/sonymn_int.cpp.

For your PR, in src/sonymn_int.cpp, I would also add || !metadata guards for functions that use:

  1. static auto getModel(const ExifData* metadata, std::string& val)
  2. static auto getAFAreaModeSetting(const ExifData* metadata, uint32_t& val)
  3. static auto getMetaVersion(const ExifData* metadata, std::string& val)
  4. static auto getFocusMode2(const ExifData* metadata, uint32_t& val)

@kevinbackhouse
Copy link
Collaborator Author

Good catch @postscript-dev! I've updated #2664 to catch those cases too. And I've added a second commit here with the extra fixes.

@kevinbackhouse kevinbackhouse marked this pull request as ready for review June 29, 2023 20:34
@kevinbackhouse kevinbackhouse merged commit 3664f5b into Exiv2:main Jun 29, 2023
109 checks passed
@kevinbackhouse kevinbackhouse deleted the metadata-null-checks branch June 29, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants