aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorOana Stratulat <oanaandreeastratulat@gmail.com>2012-01-11 00:01:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-01-14 07:19:27 +0100
commita63a86fd6f2a59d99f185e6c75b13d66b7acadab (patch)
treed04ba9bb4fc773183c6883b9d57449aa60cc8b47 /libavformat/avidec.c
parent44e191457a1268a8112ec7b35cf18de2957123b3 (diff)
downloadffmpeg-a63a86fd6f2a59d99f185e6c75b13d66b7acadab.tar.gz
Fixes issue 890: OOM with zmbv file
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 6112af42e1..c8932541c8 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -544,6 +544,10 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->start_time = 0;
avio_rl32(pb); /* buffer size */
avio_rl32(pb); /* quality */
+ if (ast->cum_len*ast->scale/ast->rate > 3600) {
+ av_log(s, AV_LOG_ERROR, "crazy start time, iam scared, giving up\n");
+ return AVERROR_INVALIDDATA;
+ }
ast->sample_size = avio_rl32(pb); /* sample ssize */
ast->cum_len *= FFMAX(1, ast->sample_size);
// av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);