summaryrefslogtreecommitdiffstats
path: root/libpostproc
diff options
context:
space:
mode:
authorPiotr Kaczuba <p.kaczuba@attika.ath.cx>2011-05-30 13:19:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-31 17:50:46 +0200
commit84fb4e9df737c856cca7767016110fc74bee56cb (patch)
treef18bd70b542d4712b7dff50173862e85bbfc9a0c /libpostproc
parenta52f598d6301eddc333002c0b2a5e9cb5dda1cf6 (diff)
downloadffmpeg-streaming-84fb4e9df737c856cca7767016110fc74bee56cb.zip
ffmpeg-streaming-84fb4e9df737c856cca7767016110fc74bee56cb.tar.gz
postprocess.c: filter name needs to be double 0 terminated
Diffstat (limited to 'libpostproc')
-rw-r--r--libpostproc/postprocess.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index b2c35f5..bfb96e1 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -86,6 +86,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
//#define DEBUG_BRIGHTNESS
#include "postprocess.h"
#include "postprocess_internal.h"
+#include "libavutil/avstring.h"
unsigned postproc_version(void)
{
@@ -766,8 +767,8 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
ppMode->maxClippedThreshold= 0.01;
ppMode->error=0;
-#undef strncpy
- strncpy(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);
@@ -823,7 +824,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;
}
OpenPOWER on IntegriCloud