Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/c2pa/c2pa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,9 +1123,14 @@ def flush_callback(ctx):
self._write_cb = WriteCallback(write_callback)
self._flush_cb = FlushCallback(flush_callback)

# Create a placeholder context as we don't actually use the context,
# but we need having a valid context pointer. Therefore, we create
# a small buffer and cast it to a StreamContext pointer
self._context = ctypes.create_string_buffer(1)

# Create the stream
self._stream = _lib.c2pa_create_stream(
None, # context
ctypes.cast(self._context, ctypes.POINTER(StreamContext)),
self._read_cb,
self._seek_cb,
self._write_cb,
Expand Down
Loading