Ensure only props owned by EXIF Object are parsed #3292

This commit is contained in:
Lovell Fuller 2022-07-13 21:33:06 +01:00
parent 6288c7bced
commit c295f06a6f
2 changed files with 6 additions and 1 deletions

View File

@ -30,6 +30,9 @@ Requires libvips v8.13.0
* Ensure `trim` operation is a no-op when it would reduce an image to nothing. * Ensure `trim` operation is a no-op when it would reduce an image to nothing.
[#3223](https://github.com/lovell/sharp/issues/3223) [#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* ## v0.30 - *dresser*
Requires libvips v8.12.2 Requires libvips v8.12.2

View File

@ -1503,7 +1503,9 @@ Napi::Value pipeline(const Napi::CallbackInfo& info) {
Napi::Array mdStrKeys = mdStrs.GetPropertyNames(); Napi::Array mdStrKeys = mdStrs.GetPropertyNames();
for (unsigned int i = 0; i < mdStrKeys.Length(); i++) { for (unsigned int i = 0; i < mdStrKeys.Length(); i++) {
std::string k = sharp::AttrAsStr(mdStrKeys, 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"); baton->timeoutSeconds = sharp::AttrAsUint32(options, "timeoutSeconds");
// Format-specific // Format-specific