Browse Source

tta: better check for totalframes.

Avoids crash, Fixes Ticket 690

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.9
Michael Niedermayer 14 years ago
parent
commit
b7c7eae7d9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/tta.c

+ 2
- 2
libavformat/tta.c View File

@@ -72,8 +72,8 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->totalframes = datalen / framelen + ((datalen % framelen) ? 1 : 0);
c->currentframe = 0;

if(c->totalframes >= UINT_MAX/sizeof(uint32_t)){
av_log(s, AV_LOG_ERROR, "totalframes too large\n");
if(c->totalframes >= UINT_MAX/sizeof(uint32_t) || c->totalframes <= 0){
av_log(s, AV_LOG_ERROR, "totalframes %d invalid\n", c->totalframes);
return -1;
}



Loading…
Cancel
Save