diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-10-08 12:11:19 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-10-08 12:11:19 +0000 |
commit | a417d041f03d725b0e159136e063538f0cee786a (patch) | |
tree | 344831470cce492c1450c9c0eab8b61aaf1d30ba | |
parent | 42d1ffa3a27d5f8bb162c6bbc99bf8631883ba8b (diff) | |
download | ffmpeg-a417d041f03d725b0e159136e063538f0cee786a.tar.gz |
10l, check 'i' validity before using it
Originally committed as revision 10684 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/dnxhddec.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 3452d49629..8ea40d1e35 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -189,6 +189,11 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int i += ctx->cid_table->run[index2]; } + if (i > 63) { + av_log(ctx->avctx, AV_LOG_ERROR, "ac tex damaged %d, %d\n", n, i); + return; + } + j = ctx->scantable.permutated[i]; //av_log(ctx->avctx, AV_LOG_DEBUG, "j %d\n", j); //av_log(ctx->avctx, AV_LOG_DEBUG, "level %d, weigth %d\n", level, weigth_matrix[i]); @@ -197,12 +202,6 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int level += 32; level >>= 6; level = (level^sign) - sign; - - if (i > 63) { - av_log(ctx->avctx, AV_LOG_ERROR, "ac tex damaged %d, %d\n", n, i); - return; - } - //av_log(NULL, AV_LOG_DEBUG, "i %d, j %d, end level %d\n", i, j, level); block[j] = level; } |