History

avformat/rpl: check channels

Fixes: 42537199/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5447162658357248 Fixes: runtime error: signed integer overflow: -3330498059201358222 * 4 cannot be represented in type 'int64_t' (aka 'long')

Michael Niedermayer committed 2 years ago

Commit beca13a1 parent b16102a1 file · +2 −0Browse files

Unified · Split

libavformat/rpl.c+2−0
@@ -205,6 +205,8 @@ static int rpl_read_header(AVFormatContext *s) · 204 unmodified lines
205205 if (ast->codecpar->sample_rate < 0)
206206 return AVERROR_INVALIDDATA;
207207 channels = read_line_and_int(pb, &error); // number of audio channels
208+ if (channels <= 0)
209+ return AVERROR_INVALIDDATA;
208210 error |= read_line(pb, line, sizeof(line));
209211 ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample
210212 av_strlcpy(audio_type, endptr, RPL_LINE_LENGTH);

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