aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-21 00:35:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 20:01:50 +0100
commitd20e948f075fb4fb1081c8ac9c3279b0fbc244d2 (patch)
tree42cc53d5270f3f348400f48a6be0f6cee96abea1
parentacbdee0a2b902884cf11b9284d1c812b7a4e51a6 (diff)
downloadffmpeg-d20e948f075fb4fb1081c8ac9c3279b0fbc244d2.tar.gz
indeo3: Fix null ptr dereference
Fixes Ticket804 Bug found by: Oana Stratulat Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 134aaa79f7f1ce1df64afc7d10d2b3de77df7b08) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/indeo3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 2c966624dd..83c97bb96d 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -770,7 +770,8 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
/* get motion vector index and setup the pointer to the mv set */
if (!ctx->need_resync)
ctx->next_cell_data = &ctx->gb.buffer[(get_bits_count(&ctx->gb) + 7) >> 3];
- curr_cell.mv_ptr = &ctx->mc_vectors[*(ctx->next_cell_data++) << 1];
+ if(ctx->mc_vectors)
+ curr_cell.mv_ptr = &ctx->mc_vectors[*(ctx->next_cell_data++) << 1];
curr_cell.tree = 1; /* enter the VQ tree */
UPDATE_BITPOS(8);
} else { /* VQ tree DATA code */