We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a97a28f commit 532825eCopy full SHA for 532825e
src/c2pa/c2pa.py
@@ -1399,8 +1399,8 @@ def wrapped_callback(
1399
# Copy the signature back to the C buffer (since callback is
1400
# used in native code)
1401
actual_len = min(len(signature), signed_len)
1402
- for i in range(actual_len):
1403
- signed_bytes_ptr[i] = signature[i]
+ # Use memmove for efficient memory copying instead of byte-by-byte loop
+ ctypes.memmove(signed_bytes_ptr, signature, actual_len)
1404
1405
# Native code expects the signed len to be returned, we oblige
1406
return actual_len
0 commit comments