Browse Source

avcodec/eatqi: print error on mb decode failure

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Michael Niedermayer 10 years ago
parent
commit
c351126ee9
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      libavcodec/eatqi.c

+ 7
- 1
libavcodec/eatqi.c View File

@@ -37,6 +37,7 @@
#include "mpeg12.h" #include "mpeg12.h"


typedef struct TqiContext { typedef struct TqiContext {
AVCodecContext *avctx;
GetBitContext gb; GetBitContext gb;
BlockDSPContext bdsp; BlockDSPContext bdsp;
BswapDSPContext bsdsp; BswapDSPContext bsdsp;
@@ -79,8 +80,11 @@ static int tqi_decode_mb(TqiContext *t, int16_t (*block)[64])
t->intra_matrix, t->intra_matrix,
t->intra_scantable.permutated, t->intra_scantable.permutated,
t->last_dc, block[n], n, 1); t->last_dc, block[n], n, 1);
if (ret < 0)
if (ret < 0) {
av_log(t->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n",
t->mb_x, t->mb_y);
return -1; return -1;
}
} }


return 0; return 0;
@@ -127,6 +131,8 @@ static int tqi_decode_frame(AVCodecContext *avctx,
AVFrame *frame = data; AVFrame *frame = data;
int ret, w, h; int ret, w, h;


t->avctx = avctx;

w = AV_RL16(&buf[0]); w = AV_RL16(&buf[0]);
h = AV_RL16(&buf[2]); h = AV_RL16(&buf[2]);
tqi_calculate_qtable(t, buf[4]); tqi_calculate_qtable(t, buf[4]);


Loading…
Cancel
Save