[Mplayer-cvslog] CVS: main/libmpcodecs vf_spp.c,1.18,1.19

Ivan Kalvachev CVS syncmail at mplayerhq.hu
Thu Apr 8 14:03:27 CEST 2004


CVS change done by Ivan Kalvachev CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv17686

Modified Files:
	vf_spp.c 
Log Message:
check for invalid user input

Index: vf_spp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_spp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- vf_spp.c	24 Feb 2004 13:28:42 -0000	1.18
+++ vf_spp.c	8 Apr 2004 12:03:24 -0000	1.19
@@ -316,7 +316,7 @@
 	dst[x + y*dst_stride + pos]= temp;
 
 	for(y=0; y<height; y++){
-		uint8_t *d= dither[y];
+		const uint8_t *d= dither[y];
 		for(x=0; x<width; x+=8){
 			int temp;
 			STORE(0);
@@ -565,6 +565,9 @@
 }
 
 static int open(vf_instance_t *vf, char* args){
+
+    int log2c;
+    
     vf->config=config;
     vf->put_image=put_image;
     vf->get_image=get_image;
@@ -581,8 +584,18 @@
     
     vf->priv->log2_count= 3;
     
-    if (args) sscanf(args, "%d:%d:%d", &vf->priv->log2_count, &vf->priv->qp, &vf->priv->mode);
+    if (args) sscanf(args, "%d:%d:%d", &log2c, &vf->priv->qp, &vf->priv->mode);
+
+    if( log2c >=0 && log2c <=6 )
+        vf->priv->log2_count = log2c;
+
+    if(vf->priv->qp < 0)
+        vf->priv->qp = 0;
+    if(vf->priv->qp > 31 )
+        vf->priv->qp = 31;
+
     switch(vf->priv->mode){
+        default:
 	case 0: requantize= hardthresh_c; break;
 	case 1: requantize= softthresh_c; break;
     }




More information about the MPlayer-cvslog mailing list