mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avcodec/cbs_sei: Always zero-initialize SEI payload
Fixes: Use-of-uninitialized value
Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5458626041413632
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit bfcee368e2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
9a4e0f6cb8
commit
67e4f737ed
@@ -40,7 +40,6 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message,
|
||||
const SEIMessageTypeDescriptor *desc)
|
||||
{
|
||||
void (*free_func)(FFRefStructOpaque, void*);
|
||||
unsigned flags = 0;
|
||||
|
||||
av_assert0(message->payload == NULL &&
|
||||
message->payload_ref == NULL);
|
||||
@@ -52,10 +51,9 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message,
|
||||
free_func = &cbs_free_user_data_unregistered;
|
||||
else {
|
||||
free_func = NULL;
|
||||
flags = FF_REFSTRUCT_FLAG_NO_ZEROING;
|
||||
}
|
||||
|
||||
message->payload_ref = ff_refstruct_alloc_ext(desc->size, flags,
|
||||
message->payload_ref = ff_refstruct_alloc_ext(desc->size, 0,
|
||||
NULL, free_func);
|
||||
if (!message->payload_ref)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user