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

ffmpeg.c:4241:1: start of procedure opt_preset()
4239. }
4240. 
4241. static int opt_preset(const char *opt, const char *arg)
      ^
4242. {
4243.     FILE *f=NULL;

ffmpeg.c:4243:5: 
4241. static int opt_preset(const char *opt, const char *arg)
4242. {
4243.     FILE *f=NULL;
          ^
4244.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4245.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4245:24: Condition is false
4243.     FILE *f=NULL;
4244.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4245.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4246.                        *opt == 'a' ? audio_codec_name :
4247.                                      subtitle_codec_name;

ffmpeg.c:4246:24: Condition is false
4244.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4245.     char *codec_name = *opt == 'v' ? video_codec_name :
4246.                        *opt == 'a' ? audio_codec_name :
                             ^
4247.                                      subtitle_codec_name;
4248. 

ffmpeg.c:4245:24: 
4243.     FILE *f=NULL;
4244.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4245.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4246.                        *opt == 'a' ? audio_codec_name :
4247.                                      subtitle_codec_name;

ffmpeg.c:4245:5: 
4243.     FILE *f=NULL;
4244.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4245.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4246.                        *opt == 'a' ? audio_codec_name :
4247.                                      subtitle_codec_name;

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

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

ffmpeg.c:4250:9: 
4248. 
4249.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4250.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4251.         ffmpeg_exit(1);
4252.     }

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

ffmpeg.c:4254:12: 
4252.     }
4253. 
4254.     while(!feof(f)){
                 ^
4255.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4256.         if(line[0] == '#' && !e)
