aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorIvan Kalvachev <ikalvachev@gmail.com>2009-02-16 22:46:30 +0000
committerIvan Kalvachev <ikalvachev@gmail.com>2009-02-16 22:46:30 +0000
commit649c171aec1c36c5975a840e49a90038a3957948 (patch)
tree503a655cceee4e1e343c0a4c755fad1c29f038b2 /libavcodec
parent7846418bdb346c344fe9ff9801a820f0cd470212 (diff)
downloadffmpeg-649c171aec1c36c5975a840e49a90038a3957948.tar.gz
Thoroughly check all fields set by the application in xvmc struct.
Originally committed as revision 17387 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo_xvmc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_xvmc.c b/libavcodec/mpegvideo_xvmc.c
index 3d56bec374..ade72739cd 100644
--- a/libavcodec/mpegvideo_xvmc.c
+++ b/libavcodec/mpegvideo_xvmc.c
@@ -90,7 +90,11 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
return -1;
}
if (render->allocated_mv_blocks < 1 ||
- render->allocated_data_blocks < mb_block_count) {
+ render->allocated_data_blocks < render->allocated_mv_blocks*mb_block_count ||
+ render->start_mv_blocks_num >= render->allocated_mv_blocks ||
+ render->next_free_data_block_num >
+ render->allocated_data_blocks -
+ mb_block_count*(render->allocated_mv_blocks-render->start_mv_blocks_num)) {
av_log(avctx, AV_LOG_ERROR,
"Rendering surface doesn't provide enough block structures to work with.\n");
return -1;