mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
obs-outputs: Fix AV1 header parser adding ref count to data
The header packets are only used within the rtmp-output and do not need or use the ref counter as the data is manually free'd directly. The presence of this ref counter causes a crash on *nix platforms due to our memory alignment hack attempting to free memory but reading the wrong offset due to the ref counter being there rather than the alignment offset.
This commit is contained in:
@@ -523,10 +523,8 @@ size_t obs_parse_av1_header(uint8_t **header, const uint8_t *data, size_t size)
|
||||
|
||||
struct array_output_data output;
|
||||
struct serializer s;
|
||||
long ref = 1;
|
||||
|
||||
array_output_serializer_init(&s, &output);
|
||||
serialize(&s, &ref, sizeof(ref));
|
||||
|
||||
s_write(&s, av1header, sizeof(av1header));
|
||||
if (seq_size)
|
||||
@@ -534,8 +532,8 @@ size_t obs_parse_av1_header(uint8_t **header, const uint8_t *data, size_t size)
|
||||
if (meta_size)
|
||||
s_write(&s, meta, meta_size);
|
||||
|
||||
*header = output.bytes.array + sizeof(ref);
|
||||
return output.bytes.num - sizeof(ref);
|
||||
*header = output.bytes.array;
|
||||
return output.bytes.num;
|
||||
}
|
||||
|
||||
static void serialize_av1_data(struct serializer *s, const uint8_t *data,
|
||||
|
||||
Reference in New Issue
Block a user