mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
avformat/pcm: Check block_align
Fixes: signed integer overflow: 321 * 8746632 cannot be represented in type 'int' Fixes: 26461/clusterfuzz-testcase-minimized-ffmpeg_dem_PVF_fuzzer-6326427831762944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
80bc2ac3c0
commit
b23a619c13
@ -39,7 +39,11 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
* Clamp to RAW_SAMPLES if larger.
|
||||
*/
|
||||
size = FFMAX(par->sample_rate/25, 1);
|
||||
size = FFMIN(size, RAW_SAMPLES) * par->block_align;
|
||||
if (par->block_align <= INT_MAX / RAW_SAMPLES) {
|
||||
size = FFMIN(size, RAW_SAMPLES) * par->block_align;
|
||||
} else {
|
||||
size = par->block_align;
|
||||
}
|
||||
|
||||
ret = av_get_packet(s->pb, pkt, size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user