You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
tta: better check for totalframes.
Avoids crash, Fixes Ticket 690 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -72,8 +72,8 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
c->totalframes = datalen / framelen + ((datalen % framelen) ? 1 : 0);
|
c->totalframes = datalen / framelen + ((datalen % framelen) ? 1 : 0);
|
||||||
c->currentframe = 0;
|
c->currentframe = 0;
|
||||||
|
|
||||||
if(c->totalframes >= UINT_MAX/sizeof(uint32_t)){
|
if(c->totalframes >= UINT_MAX/sizeof(uint32_t) || c->totalframes <= 0){
|
||||||
av_log(s, AV_LOG_ERROR, "totalframes too large\n");
|
av_log(s, AV_LOG_ERROR, "totalframes %d invalid\n", c->totalframes);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user