[x264-devel] commit: Allocate space for null terminator in param_apply_tune ( Havoc Pennington )

git at videolan.org git at videolan.org
Tue Jun 15 10:48:31 CEST 2010


x264 | branch: stable | Havoc Pennington <hp at pobox.com> | Thu Jun 10 16:28:52 2010 -0400| [71502eaf1ac591074da1f16135cc4af4087a9f3f] | committer: Jason Garrett-Glaser 

Allocate space for null terminator in param_apply_tune

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

 common/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/common.c b/common/common.c
index a5bc746..97daf52 100644
--- a/common/common.c
+++ b/common/common.c
@@ -281,7 +281,7 @@ static int x264_param_apply_preset( x264_param_t *param, const char *preset )
 
 static int x264_param_apply_tune( x264_param_t *param, const char *tune )
 {
-    char *tmp = x264_malloc( strlen( tune ) );
+    char *tmp = x264_malloc( strlen( tune ) + 1 );
     if( !tmp )
         return -1;
     tmp = strcpy( tmp, tune );



More information about the x264-devel mailing list