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

ffmpeg.c:4236:1: start of procedure opt_preset()
4234. }
4235. 
4236. static int opt_preset(const char *opt, const char *arg)
      ^
4237. {
4238.     FILE *f=NULL;

ffmpeg.c:4238:5: 
4236. static int opt_preset(const char *opt, const char *arg)
4237. {
4238.     FILE *f=NULL;
          ^
4239.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4240.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4240:24: Condition is false
4238.     FILE *f=NULL;
4239.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4240.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4241.                        *opt == 'a' ? audio_codec_name :
4242.                                      subtitle_codec_name;

ffmpeg.c:4241:24: Condition is false
4239.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4240.     char *codec_name = *opt == 'v' ? video_codec_name :
4241.                        *opt == 'a' ? audio_codec_name :
                             ^
4242.                                      subtitle_codec_name;
4243. 

ffmpeg.c:4240:24: 
4238.     FILE *f=NULL;
4239.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4240.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4241.                        *opt == 'a' ? audio_codec_name :
4242.                                      subtitle_codec_name;

ffmpeg.c:4240:5: 
4238.     FILE *f=NULL;
4239.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4240.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4241.                        *opt == 'a' ? audio_codec_name :
4242.                                      subtitle_codec_name;

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

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

ffmpeg.c:4245:9: 
4243. 
4244.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4245.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4246.         ffmpeg_exit(1);
4247.     }

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

ffmpeg.c:4249:12: 
4247.     }
4248. 
4249.     while(!feof(f)){
                 ^
4250.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4251.         if(line[0] == '#' && !e)
