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

ffmpeg.c:4178:1: start of procedure opt_preset()
4176. }
4177. 
4178. static int opt_preset(const char *opt, const char *arg)
      ^
4179. {
4180.     FILE *f=NULL;

ffmpeg.c:4180:5: 
4178. static int opt_preset(const char *opt, const char *arg)
4179. {
4180.     FILE *f=NULL;
          ^
4181.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4182.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4182:24: Condition is false
4180.     FILE *f=NULL;
4181.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4182.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4183.                        *opt == 'a' ? audio_codec_name :
4184.                                      subtitle_codec_name;

ffmpeg.c:4183:24: Condition is false
4181.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4182.     char *codec_name = *opt == 'v' ? video_codec_name :
4183.                        *opt == 'a' ? audio_codec_name :
                             ^
4184.                                      subtitle_codec_name;
4185. 

ffmpeg.c:4182:24: 
4180.     FILE *f=NULL;
4181.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4182.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4183.                        *opt == 'a' ? audio_codec_name :
4184.                                      subtitle_codec_name;

ffmpeg.c:4182:5: 
4180.     FILE *f=NULL;
4181.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4182.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4183.                        *opt == 'a' ? audio_codec_name :
4184.                                      subtitle_codec_name;

ffmpeg.c:4186:64: Condition is false
4184.                                      subtitle_codec_name;
4185. 
4186.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
                                                                     ^
4187.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4188.         exit_program(1);

ffmpeg.c:4186:11: Taking true branch
4184.                                      subtitle_codec_name;
4185. 
4186.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
                ^
4187.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4188.         exit_program(1);

ffmpeg.c:4187:9: 
4185. 
4186.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4187.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4188.         exit_program(1);
4189.     }

ffmpeg.c:4188:9: Skipping exit_program(): empty list of specs
4186.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4187.         fprintf(stderr, "File for preset '%s' not found\n", arg);
4188.         exit_program(1);
              ^
4189.     }
4190. 

ffmpeg.c:4191:12: 
4189.     }
4190. 
4191.     while(!feof(f)){
                 ^
4192.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4193.         if(line[0] == '#' && !e)
