Skip to content

Commit

Permalink
Ensure only props owned by EXIF Object are parsed #3292
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Jul 13, 2022
1 parent 6288c7b commit c295f06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changelog.md
Expand Up @@ -30,6 +30,9 @@ Requires libvips v8.13.0
* Ensure `trim` operation is a no-op when it would reduce an image to nothing.
[#3223](https://github.com/lovell/sharp/issues/3223)

* Ensure only properties owned by the `withMetadata` EXIF Object are parsed.
[#3292](https://github.com/lovell/sharp/issues/3292)

## v0.30 - *dresser*

Requires libvips v8.12.2
Expand Down
4 changes: 3 additions & 1 deletion src/pipeline.cc
Expand Up @@ -1503,7 +1503,9 @@ Napi::Value pipeline(const Napi::CallbackInfo& info) {
Napi::Array mdStrKeys = mdStrs.GetPropertyNames();
for (unsigned int i = 0; i < mdStrKeys.Length(); i++) {
std::string k = sharp::AttrAsStr(mdStrKeys, i);
baton->withMetadataStrs.insert(std::make_pair(k, sharp::AttrAsStr(mdStrs, k)));
if (mdStrs.HasOwnProperty(k)) {
baton->withMetadataStrs.insert(std::make_pair(k, sharp::AttrAsStr(mdStrs, k)));
}
}
baton->timeoutSeconds = sharp::AttrAsUint32(options, "timeoutSeconds");
// Format-specific
Expand Down

0 comments on commit c295f06

Please sign in to comment.