summaryrefslogtreecommitdiff
path: root/libavformat/tta.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-27 15:37:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-27 15:37:15 +0100
commitb7c7eae7d995b54765c3d7a027cd8b542f777fa1 (patch)
treee96d13a00be7cc3e664e5cd3ae8753658f0959ad /libavformat/tta.c
parent102a2463d3a3f2c46f6ef9b30803491b91ffb653 (diff)
tta: better check for totalframes.
Avoids crash, Fixes Ticket 690 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r--libavformat/tta.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c
index 4d0c6adeee..470ee2bf1a 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -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;
}