History

avcodec/cbs_sei: Always zero-initialize SEI payload

Fixes: Use-of-uninitialized value Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5458626041413632

Andreas Rheinhardt committed 2 years ago

Commit bfcee361 parent 5dfc0cc1 file · +1 −3Browse files

Unified · Split

libavcodec/cbs_sei.c+1−3
@@ -41,7 +41,6 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, · 40 unmodified lines
41 const SEIMessageTypeDescriptor *desc)41 const SEIMessageTypeDescriptor *desc)
42{42{
43 void (*free_func)(FFRefStructOpaque, void*);43 void (*free_func)(FFRefStructOpaque, void*);
44 unsigned flags = 0;
45 44
46 av_assert0(message->payload == NULL &&45 av_assert0(message->payload == NULL &&
47 message->payload_ref == NULL);46 message->payload_ref == NULL);
@@ -53,10 +52,9 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, · 5 unmodified lines
53 free_func = &cbs_free_user_data_unregistered;52 free_func = &cbs_free_user_data_unregistered;
54 else {53 else {
55 free_func = NULL;54 free_func = NULL;
56 flags = FF_REFSTRUCT_FLAG_NO_ZEROING;
57 }55 }
58 56
59 message->payload_ref = ff_refstruct_alloc_ext(desc->size, flags,57 message->payload_ref = ff_refstruct_alloc_ext(desc->size, 0,
60 NULL, free_func);58 NULL, free_func);
61 if (!message->payload_ref)59 if (!message->payload_ref)
62 return AVERROR(ENOMEM);60 return AVERROR(ENOMEM);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t