]> git.videolan.org Git - x264.git/commitdiff
Allocate space for null terminator in param_apply_tune
authorHavoc Pennington <hp@pobox.com>
Thu, 10 Jun 2010 20:28:52 +0000 (16:28 -0400)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Mon, 14 Jun 2010 22:40:10 +0000 (15:40 -0700)
common/common.c

index a5bc7469cc4c4173eed811fa7e193cded4c173b7..97daf52965ecc1ba7e02a13aa3d63b30d5675af7 100644 (file)
@@ -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 );