comparison libmpcodecs/vd_hmblck.c @ 35148:89660feadcce

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.
author iive
date Thu, 11 Oct 2012 22:06:42 +0000
parents 4d8d26a9d66a
children fbe4b3716aa0
comparison
equal deleted inserted replaced
35147:4d8d26a9d66a 35148:89660feadcce
80 } 80 }
81 /************************************************************************* 81 /*************************************************************************
82 * init driver 82 * init driver
83 */ 83 */
84 static int init(sh_video_t *sh){ 84 static int init(sh_video_t *sh){
85
86 if(sh->format != IMGFMT_HM12) return 0;
87
88 if((sh->disp_w&31) != 0 || (sh->disp_h&31) != 0) {
89 mp_msg(MSGT_DECVIDEO, MSGL_ERR,
90 "hmblck: Image size must be multiple of 32.\n");
91 return 0;
92 }
85 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format); 93 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
86 } 94 }
87 /************************************************************************* 95 /*************************************************************************
88 * uninit driver 96 * uninit driver
89 */ 97 */