ffmpeg.c:4239: error: Null Dereference
  pointer `f` last assigned on line 4234 could be null and is dereferenced by call to `feof()` at line 4239, column 12.

ffmpeg.c:4226:1: start of procedure opt_preset()
4224. }
4225. 
4226. static int opt_preset(const char *opt, const char *arg)
      ^
4227. {
4228.     FILE *f=NULL;

ffmpeg.c:4228:5: 
4226. static int opt_preset(const char *opt, const char *arg)
4227. {
4228.     FILE *f=NULL;
          ^
4229.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4230.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4230:24: Condition is false
4228.     FILE *f=NULL;
4229.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4230.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4231.                        *opt == 'a' ? audio_codec_name :
4232.                                      subtitle_codec_name;

ffmpeg.c:4231:24: Condition is false
4229.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4230.     char *codec_name = *opt == 'v' ? video_codec_name :
4231.                        *opt == 'a' ? audio_codec_name :
                             ^
4232.                                      subtitle_codec_name;
4233. 

ffmpeg.c:4230:24: 
4228.     FILE *f=NULL;
4229.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4230.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4231.                        *opt == 'a' ? audio_codec_name :
4232.                                      subtitle_codec_name;

ffmpeg.c:4230:5: 
4228.     FILE *f=NULL;
4229.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4230.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4231.                        *opt == 'a' ? audio_codec_name :
4232.                                      subtitle_codec_name;

ffmpeg.c:4234:64: Condition is false
4232.                                      subtitle_codec_name;
4233. 
4234.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
                                                                     ^
4235.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4236.         ffmpeg_exit(1);

ffmpeg.c:4234:11: Taking true branch
4232.                                      subtitle_codec_name;
4233. 
4234.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
                ^
4235.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4236.         ffmpeg_exit(1);

ffmpeg.c:4235:9: 
4233. 
4234.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4235.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4236.         ffmpeg_exit(1);
4237.     }

ffmpeg.c:4236:9: Skipping ffmpeg_exit(): empty list of specs
4234.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4235.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4236.         ffmpeg_exit(1);
              ^
4237.     }
4238. 

ffmpeg.c:4239:12: 
4237.     }
4238. 
4239.     while(!feof(f)){
                 ^
4240.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4241.         if(line[0] == '#' && !e)
