diff options
author | Ivan Kalvachev <ikalvachev@gmail.com> | 2009-02-19 09:55:52 +0000 |
---|---|---|
committer | Ivan Kalvachev <ikalvachev@gmail.com> | 2009-02-19 09:55:52 +0000 |
commit | 859bb3cfee28efff9c965d4c9320c7837b85849e (patch) | |
tree | d887b971e991ec74d6d6dfefac8e1466d68ad989 /libavcodec | |
parent | 9cfc1b3a840926435c2024fe7537e648405704fc (diff) | |
download | ffmpeg-859bb3cfee28efff9c965d4c9320c7837b85849e.tar.gz |
Add more paranoid checks of xvmc token.
Originally committed as revision 17453 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo_xvmc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_xvmc.c b/libavcodec/mpegvideo_xvmc.c index b6283b0567..bff9543a0c 100644 --- a/libavcodec/mpegvideo_xvmc.c +++ b/libavcodec/mpegvideo_xvmc.c @@ -78,7 +78,10 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx) 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 |