mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/tta: Better totalframes check
Fixes: signed integer overflow: 4 * 740491135 cannot be represented in type 'int'
Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-6298893367508992
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5f0d00464a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5765e49ec3
commit
75d9ad3759
|
@ -91,7 +91,7 @@ static int tta_read_header(AVFormatContext *s)
|
|||
c->totalframes = nb_samples / c->frame_size + (c->last_frame_size < c->frame_size);
|
||||
c->currentframe = 0;
|
||||
|
||||
if(c->totalframes >= UINT_MAX/sizeof(uint32_t) || c->totalframes <= 0){
|
||||
if(c->totalframes >= (INT_MAX - 4)/sizeof(uint32_t) || c->totalframes <= 0){
|
||||
av_log(s, AV_LOG_ERROR, "totalframes %d invalid\n", c->totalframes);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue