[MPlayer-cvslog] r35242 - trunk/libmpcodecs/vd_hmblck.c

iive subversion at mplayerhq.hu
Fri Oct 12 00:06:42 CEST 2012


Author: iive
Date: Fri Oct 12 00:06:42 2012
New Revision: 35242

Log:
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.

Modified:
   trunk/libmpcodecs/vd_hmblck.c

Modified: trunk/libmpcodecs/vd_hmblck.c
==============================================================================
--- trunk/libmpcodecs/vd_hmblck.c	Thu Oct 11 23:50:18 2012	(r35241)
+++ trunk/libmpcodecs/vd_hmblck.c	Fri Oct 12 00:06:42 2012	(r35242)
@@ -82,6 +82,14 @@ static int control(sh_video_t *sh,int cm
  * 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);
 }
 /*************************************************************************


More information about the MPlayer-cvslog mailing list