# HG changeset patch # User iive # Date 1081425804 0 # Node ID e26d5e388618505ca48717580211d709fbfa09c8 # Parent ff9f315741a7129d872451c88d7d8f2fc33d3954 check for invalid user input diff -r ff9f315741a7 -r e26d5e388618 libmpcodecs/vf_spp.c --- a/libmpcodecs/vf_spp.c Wed Apr 07 22:51:42 2004 +0000 +++ b/libmpcodecs/vf_spp.c Thu Apr 08 12:03:24 2004 +0000 @@ -316,7 +316,7 @@ dst[x + y*dst_stride + pos]= temp; for(y=0; yconfig=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; }