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
126 if (avio_rl32(s->pb) != APM_FILE_EXTRADATA_SIZE)126 if (avio_rl32(s->pb) != APM_FILE_EXTRADATA_SIZE)
127 return AVERROR_INVALIDDATA;127 return AVERROR_INVALIDDATA;
128 128
129 /* I've never seen files greater than this. */129 /* 8 = bits per sample * max channels */
130 if (par->sample_rate > 44100)130 if (par->sample_rate > (INT_MAX / 8))
131 return AVERROR_INVALIDDATA;131 return AVERROR_INVALIDDATA;
132 132
133 if (par->bits_per_coded_sample != 4)133 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