Ticket #890: 0001-Fixes-issue-890-OOM-with-zmbv-file.patch

File 0001-Fixes-issue-890-OOM-with-zmbv-file.patch, 1.1 KB (added by Oana Stratulat, 15 years ago)

Patch for the ticket

  • libavformat/avidec.c

    From 35c47d19732c243214909dc525f7d3ccbbdcb6c1 Mon Sep 17 00:00:00 2001
    From: Oana Stratulat <oanaandreeastratulat@gmail.com>
    Date: Wed, 11 Jan 2012 00:01:09 +0200
    Subject: [PATCH] Fixes issue 890: OOM with zmbv file
    
    ---
     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 b static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)  
    544544            st->start_time = 0;
    545545            avio_rl32(pb); /* buffer size */
    546546            avio_rl32(pb); /* quality */
     547            if (ast->cum_len*ast->scale/ast->rate > 3600) {
     548                av_log(s, AV_LOG_ERROR, "crazy start time, iam scared, giving up\n");
     549                return AVERROR_INVALIDDATA;
     550            }
    547551            ast->sample_size = avio_rl32(pb); /* sample ssize */
    548552            ast->cum_len *= FFMAX(1, ast->sample_size);
    549553//            av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);