Skip to content

Commit 532825e

Browse files
committed
fix: Logic
1 parent a97a28f commit 532825e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/c2pa/c2pa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,8 @@ def wrapped_callback(
13991399
# Copy the signature back to the C buffer (since callback is
14001400
# used in native code)
14011401
actual_len = min(len(signature), signed_len)
1402-
for i in range(actual_len):
1403-
signed_bytes_ptr[i] = signature[i]
1402+
# Use memmove for efficient memory copying instead of byte-by-byte loop
1403+
ctypes.memmove(signed_bytes_ptr, signature, actual_len)
14041404

14051405
# Native code expects the signed len to be returned, we oblige
14061406
return actual_len

0 commit comments

Comments
 (0)