forked from FFmpeg/FFmpeg
avformat/iamf_reader: Initialize padding and check read in ff_iamf_read_packet()
Fixes: Use of uninitialized memory Fixes: 377642312/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554550985424896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
788abe0d25
commit
aec2933344
1 changed files with 3 additions and 1 deletions
|
@ -282,7 +282,7 @@ int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c,
|
|||
int read = 0;
|
||||
|
||||
while (1) {
|
||||
uint8_t header[MAX_IAMF_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t header[MAX_IAMF_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE] = {0};
|
||||
enum IAMF_OBU_Type type;
|
||||
unsigned obu_size;
|
||||
unsigned skip_samples, discard_padding;
|
||||
|
@ -294,6 +294,8 @@ int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c,
|
|||
size = avio_read(pb, header, FFMIN(MAX_IAMF_OBU_HEADER_SIZE, max_size));
|
||||
if (size < 0)
|
||||
return size;
|
||||
if (size != FFMIN(MAX_IAMF_OBU_HEADER_SIZE, max_size))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
len = ff_iamf_parse_obu_header(header, size, &obu_size, &start_pos, &type,
|
||||
&skip_samples, &discard_padding);
|
||||
|
|
Loading…
Add table
Reference in a new issue