[FFmpeg-cvslog] Fixes issue 890: OOM with zmbv file
Oana Stratulat
git at videolan.org
Sat Jan 14 07:27:59 CET 2012
ffmpeg | branch: master | Oana Stratulat <oanaandreeastratulat at gmail.com> | Wed Jan 11 00:01:09 2012 +0200| [a63a86fd6f2a59d99f185e6c75b13d66b7acadab] | committer: Michael Niedermayer
Fixes issue 890: OOM with zmbv file
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a63a86fd6f2a59d99f185e6c75b13d66b7acadab
---
libavformat/avidec.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 6112af4..c893254 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);
More information about the ffmpeg-cvslog
mailing list