comparison mpegvideo_xvmc.c @ 8983:436e7d43db62 libavcodec

Add more paranoid checks of xvmc token.
author iive
date Thu, 19 Feb 2009 09:55:52 +0000
parents 8ebe84eae835
children b595a8a59967
comparison
equal deleted inserted replaced
8982:a24c04956930 8983:436e7d43db62
76 struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.data[2]; 76 struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.data[2];
77 const int mb_block_count = 4 + (1 << s->chroma_format); 77 const int mb_block_count = 4 + (1 << s->chroma_format);
78 78
79 assert(avctx); 79 assert(avctx);
80 if (!render || render->xvmc_id != AV_XVMC_ID || 80 if (!render || render->xvmc_id != AV_XVMC_ID ||
81 !render->data_blocks || !render->mv_blocks) { 81 !render->data_blocks || !render->mv_blocks ||
82 (unsigned int)render->allocated_mv_blocks > INT_MAX/(64*6) ||
83 (unsigned int)render->allocated_data_blocks > INT_MAX/64 ||
84 !render->p_surface) {
82 av_log(avctx, AV_LOG_ERROR, 85 av_log(avctx, AV_LOG_ERROR,
83 "Render token doesn't look as expected.\n"); 86 "Render token doesn't look as expected.\n");
84 return -1; // make sure that this is a render packet 87 return -1; // make sure that this is a render packet
85 } 88 }
86 89