From c8a773ebfca148ef04f5a60d42cbd7336af0baf6 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Tue, 20 Jan 2015 15:57:41 +0000 Subject: [PATCH] Validate frame packing value instead of clipping --- encoder/encoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ) -- 2.40.0