contentauth / c2pa-rs

Rust SDK for the core C2PA (Coalition for Content Provenance and Authenticity) specification
Other
99 stars 42 forks source link

No need in the `Builder::add_resource` taking ownership of the resource stream; use reference instead #479

Open brogdonm opened 4 weeks ago

brogdonm commented 4 weeks ago

Changes in this pull request

Give a narrative description of what has been changed.

Previously, the Builder::add_resource method takes ownership of the resource stream. This is unnecessary and taking the stream as a reference allows for the stream to be used over and over again between calls (especially in long running processes).

The method also required the stream to be seekable, but this isn't necessary either as the stream is read into a memory buffer.

Checklist

brogdonm commented 3 weeks ago

@mauricefisher64 @gpeacock The vulnerability failure appears after merging the latest main into this branch.