# HG changeset patch # User iive # Date 1349993202 0 # Node ID 89660feadcce1d0e1920af3ec16c60991c203aaf # Parent 4d8d26a9d66a4f03ae25ec968c99fa6582d151fe Add necessary checks to the vd_hmblck input. The code assumes the input image contains whole macroblocks (16x16). Since same thing applies to the downsampled chroma channels, the final requirement is the image to be multiple of 32. Also, add explicit pixel format check at init. diff -r 4d8d26a9d66a -r 89660feadcce libmpcodecs/vd_hmblck.c --- a/libmpcodecs/vd_hmblck.c Thu Oct 11 21:50:18 2012 +0000 +++ b/libmpcodecs/vd_hmblck.c Thu Oct 11 22:06:42 2012 +0000 @@ -82,6 +82,14 @@ * init driver */ static int init(sh_video_t *sh){ + + if(sh->format != IMGFMT_HM12) return 0; + + if((sh->disp_w&31) != 0 || (sh->disp_h&31) != 0) { + mp_msg(MSGT_DECVIDEO, MSGL_ERR, + "hmblck: Image size must be multiple of 32.\n"); + return 0; + } return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format); } /*************************************************************************