[FFmpeg-devel] [PATCH 1/2] ffserver: dont leak child arguments

Reynaldo H. Verdejo Pinochet reynaldo at osg.samsung.com
Wed Nov 26 16:19:28 CET 2014


Hi

On 11/20/2014 08:51 PM, Lukasz Marek wrote:
> [..]
>>       }
>> diff --git a/ffserver_config.c b/ffserver_config.c
>> index 02c8431..a235142 100644
>> --- a/ffserver_config.c
>> +++ b/ffserver_config.c
>> @@ -31,6 +31,8 @@
>>   #include "cmdutils.h"
>>   #include "ffserver_config.h"
>>
>> +#define MAX_CHILD_ARGS 64
>> +
>>   static int ffserver_save_avoption(AVCodecContext *ctx, const char
>> *opt, const char *arg,
>>                                     AVDictionary **dict, int type,
>> FFServerConfig *config, int line_num);
>>   static void vreport_config_error(const char *filename, int line_num,
>> int log_level,
>> @@ -603,7 +605,7 @@ static int
>> ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, c
>>       if (!av_strcasecmp(cmd, "Launch")) {
>>           int i;
>>
>> -        feed->child_argv = av_mallocz(64 * sizeof(char *));
>> +        feed->child_argv = av_mallocz_array(MAX_CHILD_ARGS,
>> sizeof(char *));
>>           if (!feed->child_argv)
>>               return AVERROR(ENOMEM);
>>           for (i = 0; i < 62; i++) {
> 
> Right after submit I notice this hardcoded 62 so I changed locally to
> MAX_CHILD_ARGS - 2 :]

Cool. Feel free to push please.

Thanks a lot

-- 
Reynaldo


More information about the ffmpeg-devel mailing list