Ticket #484: 0001-at-least-try-to-decode-4444-even-if-output-is-somewh.patch

File 0001-at-least-try-to-decode-4444-even-if-output-is-somewh.patch, 1.6 KB (added by jonne_jvl, 5 years ago)
  • libavcodec/proresdec.c

    From c6f936158889b816eaaf5e124f61a44dfd574bdc Mon Sep 17 00:00:00 2001
    From: jonne ahner<jonne.ahner@gmail.com>
    Date: Sun, 18 Sep 2011 14:50:15 +0200
    Subject: [PATCH] at least try to decode 4444 even if output is somewhat defective
    
    ---
     libavcodec/proresdec.c |   11 ++++++++---
     1 files changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c
    index c56b258..fa4e590 100644
    a b static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, 
    141141 
    142142    version = AV_RB16(buf + 2); 
    143143    av_dlog(avctx, "%.4s version %d\n", buf+4, version); 
    144     if (version != 0) { 
     144    if (version > 1) { 
    145145        av_log(avctx, AV_LOG_ERROR, "unsupported version: %d\n", version); 
    146146        return -1; 
     147    } else if (version == 1) { 
     148        av_log(avctx, AV_LOG_INFO, "experimental version: %d\n", version); 
    147149    } 
    148150 
    149151    width  = AV_RB16(buf + 8); 
    static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, 
    539541    int buf_size = avpkt->size; 
    540542    int frame_hdr_size, pic_size; 
    541543 
    542     if (buf_size < 28 || buf_size != AV_RB32(buf) || 
    543         AV_RL32(buf +  4) != AV_RL32("icpf")) { 
     544    if (buf_size < 28 || AV_RL32(buf +  4) != AV_RL32("icpf")) { 
    544545        av_log(avctx, AV_LOG_ERROR, "invalid frame header\n"); 
    545546        return -1; 
    546547    } 
    547548 
     549    if (buf_size != AV_RB32(buf)) { 
     550        av_log(avctx, AV_LOG_INFO, "buf_size != frame size (difference: %d bytes) \n", abs(AV_RB32(buf) - buf_size)); 
     551    } 
     552 
    548553    ctx->first_field = 1; 
    549554 
    550555    buf += 8;