From: Vittorio Giovara Date: Tue, 20 Jan 2015 15:57:41 +0000 (+0000) Subject: Validate frame packing value instead of clipping X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8a773ebfca148ef04f5a60d42cbd7336af0baf6;p=libx264 Validate frame packing value instead of clipping --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 4f412b50..644ddb0d 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -586,7 +586,11 @@ static int x264_validate_parameters( x264_t *h, int b_open ) h->param.i_dpb_size = 1; } - h->param.i_frame_packing = x264_clip3( h->param.i_frame_packing, -1, 5 ); + if( h->param.i_frame_packing < -1 || h->param.i_frame_packing > 5 ) + { + x264_log( h, X264_LOG_WARNING, "ignoring unknown frame packing value\n" ); + h->param.i_frame_packing = -1; + } /* Detect default ffmpeg settings and terminate with an error. */ if( b_open )