]> granicus.if.org Git - libx264/commitdiff
Basic sanity checking of qpmax/qpmin options
authorFiona Glaser <fiona@x264.com>
Wed, 30 Jul 2008 21:28:21 +0000 (15:28 -0600)
committerFiona Glaser <fiona@x264.com>
Wed, 30 Jul 2008 21:28:21 +0000 (15:28 -0600)
encoder/encoder.c

index cb2d0ce0d18dbfaa8610d3cf84e74d67a619700b..76fd1454888ce10a10c1e309b4cc6d736f98a7df 100644 (file)
@@ -421,6 +421,8 @@ static int x264_validate_parameters( x264_t *h )
         h->param.rc.i_qp_max = x264_clip3( (int)(X264_MAX3( qp_p, qp_i, qp_b ) + .999), 0, 51 );
         h->param.rc.i_aq_mode = 0;
     }
+    h->param.rc.i_qp_max = x264_clip3( h->param.rc.i_qp_max, 0, 51 );
+    h->param.rc.i_qp_min = x264_clip3( h->param.rc.i_qp_min, 0, h->param.rc.i_qp_max );
 
     if( ( h->param.i_width % 16 || h->param.i_height % 16 )
         && h->param.i_height != 1080 && !h->mb.b_lossless )