File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1123,13 +1123,14 @@ def flush_callback(ctx):
11231123 self ._write_cb = WriteCallback (write_callback )
11241124 self ._flush_cb = FlushCallback (flush_callback )
11251125
1126- # Create a dummy context since Python callbacks don't use it
1127- # We create a small buffer and cast it to a StreamContext pointer
1128- self ._dummy_context = ctypes .create_string_buffer (1 ) # Create a 1-byte buffer
1129-
1126+ # Create a (placeholder) context we don't actually use the context,
1127+ # but we need having a valid context pointer. Therefore, we create
1128+ # a small buffer and cast it to a StreamContext pointer
1129+ self ._placeholder_context = ctypes .create_string_buffer (1 )
1130+
11301131 # Create the stream
11311132 self ._stream = _lib .c2pa_create_stream (
1132- ctypes .cast (self ._dummy_context , ctypes .POINTER (StreamContext )), # context
1133+ ctypes .cast (self ._placeholder_context , ctypes .POINTER (StreamContext )), # context
11331134 self ._read_cb ,
11341135 self ._seek_cb ,
11351136 self ._write_cb ,
You can’t perform that action at this time.
0 commit comments