postprocess.c: filter name needs to be double 0 terminated
authorPiotr Kaczuba <p.kaczuba@attika.ath.cx>
Mon, 30 May 2011 11:19:35 +0000 (13:19 +0200)
committerReinhard Tartler <siretart@tauware.de>
Fri, 26 Aug 2011 18:28:54 +0000 (20:28 +0200)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
libpostproc/postprocess.c

index ca6d85f..fb51d94 100644 (file)
@@ -731,7 +731,8 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
     ppMode->maxClippedThreshold= 0.01;
     ppMode->error=0;
 
-    av_strlcpy(temp, name, GET_MODE_BUFFER_SIZE);
+    memset(temp, 0, GET_MODE_BUFFER_SIZE);
+    av_strlcpy(temp, name, GET_MODE_BUFFER_SIZE - 1);
 
     av_log(NULL, AV_LOG_DEBUG, "pp: %s\n", name);
 
@@ -787,7 +788,7 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
 
                 plen= strlen(p);
                 spaceLeft= p - temp + plen;
-                if(spaceLeft + newlen  >= GET_MODE_BUFFER_SIZE){
+                if(spaceLeft + newlen  >= GET_MODE_BUFFER_SIZE - 1){
                     ppMode->error++;
                     break;
                 }