[x264-devel] Validate frame packing value instead of clipping

Vittorio Giovara git at videolan.org
Tue Feb 24 20:37:44 CET 2015


x264 | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Tue Jan 20 15:57:41 2015 +0000| [c8a773ebfca148ef04f5a60d42cbd7336af0baf6] | committer: Anton Mitrofanov

Validate frame packing value instead of clipping

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=c8a773ebfca148ef04f5a60d42cbd7336af0baf6
---

 encoder/encoder.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index 4f412b5..644ddb0 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 )



More information about the x264-devel mailing list