]> git.sesse.net Git - x264/commitdiff
Validate frame packing value instead of clipping
authorVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 20 Jan 2015 15:57:41 +0000 (15:57 +0000)
committerAnton Mitrofanov <BugMaster@narod.ru>
Mon, 23 Feb 2015 10:34:52 +0000 (13:34 +0300)
encoder/encoder.c

index 4f412b50b17e5f4b730d146aa8d9f5178809d90e..644ddb0de40359b810322be08a10871f7e0c011f 100644 (file)
@@ -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 )