Mercurial > libavcodec.hg
changeset 8983:436e7d43db62 libavcodec
Add more paranoid checks of xvmc token.
author | iive |
---|---|
date | Thu, 19 Feb 2009 09:55:52 +0000 |
parents | a24c04956930 |
children | eb0da8917f17 |
files | mpegvideo_xvmc.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegvideo_xvmc.c Thu Feb 19 08:39:47 2009 +0000 +++ b/mpegvideo_xvmc.c Thu Feb 19 09:55:52 2009 +0000 @@ -78,7 +78,10 @@ assert(avctx); if (!render || render->xvmc_id != AV_XVMC_ID || - !render->data_blocks || !render->mv_blocks) { + !render->data_blocks || !render->mv_blocks || + (unsigned int)render->allocated_mv_blocks > INT_MAX/(64*6) || + (unsigned int)render->allocated_data_blocks > INT_MAX/64 || + !render->p_surface) { av_log(avctx, AV_LOG_ERROR, "Render token doesn't look as expected.\n"); return -1; // make sure that this is a render packet