History

avformat/rpl: reject invalid sample rate

Fixes overflow check for bit_rate multiplication few lines below. Found by OSS-Fuzz.

Kacper Michajłow committed 2 years ago

Commit a3d3a581 parent dce69ba1 file · +2 −0Browse files

Unified · Split

libavformat/rpl.c+2−0
@@ -202,6 +202,8 @@ static int rpl_read_header(AVFormatContext *s) · 201 unmodified lines
202 ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;202 ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
203 ast->codecpar->codec_tag = audio_format;203 ast->codecpar->codec_tag = audio_format;
204 ast->codecpar->sample_rate = read_line_and_int(pb, &error); // audio bitrate204 ast->codecpar->sample_rate = read_line_and_int(pb, &error); // audio bitrate
205 if (ast->codecpar->sample_rate < 0)
206 return AVERROR_INVALIDDATA;
205 channels = read_line_and_int(pb, &error); // number of audio channels207 channels = read_line_and_int(pb, &error); // number of audio channels
206 error |= read_line(pb, line, sizeof(line));208 error |= read_line(pb, line, sizeof(line));
207 ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample209 ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample

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