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

ffmpeg.c:4216:1: start of procedure opt_preset()
4214. }
4215. 
4216. static int opt_preset(const char *opt, const char *arg)
      ^
4217. {
4218.     FILE *f=NULL;

ffmpeg.c:4218:5: 
4216. static int opt_preset(const char *opt, const char *arg)
4217. {
4218.     FILE *f=NULL;
          ^
4219.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4220.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4220:24: Condition is false
4218.     FILE *f=NULL;
4219.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4220.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4221.                        *opt == 'a' ? audio_codec_name :
4222.                                      subtitle_codec_name;

ffmpeg.c:4221:24: Condition is false
4219.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4220.     char *codec_name = *opt == 'v' ? video_codec_name :
4221.                        *opt == 'a' ? audio_codec_name :
                             ^
4222.                                      subtitle_codec_name;
4223. 

ffmpeg.c:4220:24: 
4218.     FILE *f=NULL;
4219.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4220.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4221.                        *opt == 'a' ? audio_codec_name :
4222.                                      subtitle_codec_name;

ffmpeg.c:4220:5: 
4218.     FILE *f=NULL;
4219.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4220.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4221.                        *opt == 'a' ? audio_codec_name :
4222.                                      subtitle_codec_name;

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

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

ffmpeg.c:4225:9: 
4223. 
4224.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4225.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4226.         ffmpeg_exit(1);
4227.     }

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

ffmpeg.c:4229:12: 
4227.     }
4228. 
4229.     while(!feof(f)){
                 ^
4230.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4231.         if(line[0] == '#' && !e)
