History

avcodec/apm: fix sample_rate check

Zane van Iperen committed 6 years ago

Commit 8598fc41 parent 081e3001 file · +2 −2Browse files

Unified · Split

libavformat/apm.c+2−2
@@ -126,8 +126,8 @@ static int apm_read_header(AVFormatContext *s) · 125 unmodified lines
126126 if (avio_rl32(s->pb) != APM_FILE_EXTRADATA_SIZE)
127127 return AVERROR_INVALIDDATA;
128128
129− /* I've never seen files greater than this. */
130− if (par->sample_rate > 44100)
129+ /* 8 = bits per sample * max channels */
130+ if (par->sample_rate > (INT_MAX / 8))
131131 return AVERROR_INVALIDDATA;
132132
133133 if (par->bits_per_coded_sample != 4)

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