mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
postprocess.c: filter name needs to be double 0 terminated
This commit is contained in:
parent
a52f598d63
commit
84fb4e9df7
@ -86,6 +86,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
|
|||||||
//#define DEBUG_BRIGHTNESS
|
//#define DEBUG_BRIGHTNESS
|
||||||
#include "postprocess.h"
|
#include "postprocess.h"
|
||||||
#include "postprocess_internal.h"
|
#include "postprocess_internal.h"
|
||||||
|
#include "libavutil/avstring.h"
|
||||||
|
|
||||||
unsigned postproc_version(void)
|
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->maxClippedThreshold= 0.01;
|
||||||
ppMode->error=0;
|
ppMode->error=0;
|
||||||
|
|
||||||
#undef strncpy
|
memset(temp, 0, GET_MODE_BUFFER_SIZE);
|
||||||
strncpy(temp, name, GET_MODE_BUFFER_SIZE);
|
av_strlcpy(temp, name, GET_MODE_BUFFER_SIZE - 1);
|
||||||
|
|
||||||
av_log(NULL, AV_LOG_DEBUG, "pp: %s\n", name);
|
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);
|
plen= strlen(p);
|
||||||
spaceLeft= p - temp + plen;
|
spaceLeft= p - temp + plen;
|
||||||
if(spaceLeft + newlen >= GET_MODE_BUFFER_SIZE){
|
if(spaceLeft + newlen >= GET_MODE_BUFFER_SIZE - 1){
|
||||||
ppMode->error++;
|
ppMode->error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user