History

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

Michael Niedermayer committed 1 year ago

Commit aec29331 parent 788abe01 file · +3 −1Browse files

Unified · Split

libavformat/iamf_reader.c+3−1
@@ -282,7 +282,7 @@ int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c, · 281 unmodified lines
282282 int read = 0;
283283
284284 while (1) {
285− uint8_t header[MAX_IAMF_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
285+ uint8_t header[MAX_IAMF_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE] = {0};
286286 enum IAMF_OBU_Type type;
287287 unsigned obu_size;
288288 unsigned skip_samples, discard_padding;
@@ -294,6 +294,8 @@ int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c, · 5 unmodified lines
294294 size = avio_read(pb, header, FFMIN(MAX_IAMF_OBU_HEADER_SIZE, max_size));
295295 if (size < 0)
296296 return size;
297+ if (size != FFMIN(MAX_IAMF_OBU_HEADER_SIZE, max_size))
298+ return AVERROR_INVALIDDATA;
297299
298300 len = ff_iamf_parse_obu_header(header, size, &obu_size, &start_pos, &type,
299301 &skip_samples, &discard_padding);

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