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

ffmpeg.c:4168:1: start of procedure opt_preset()
4166. }
4167. 
4168. static int opt_preset(const char *opt, const char *arg)
      ^
4169. {
4170.     FILE *f=NULL;

ffmpeg.c:4170:5: 
4168. static int opt_preset(const char *opt, const char *arg)
4169. {
4170.     FILE *f=NULL;
          ^
4171.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4172.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4172:24: Condition is false
4170.     FILE *f=NULL;
4171.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4172.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4173.                        *opt == 'a' ? audio_codec_name :
4174.                                      subtitle_codec_name;

ffmpeg.c:4173:24: Condition is false
4171.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4172.     char *codec_name = *opt == 'v' ? video_codec_name :
4173.                        *opt == 'a' ? audio_codec_name :
                             ^
4174.                                      subtitle_codec_name;
4175. 

ffmpeg.c:4172:24: 
4170.     FILE *f=NULL;
4171.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4172.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4173.                        *opt == 'a' ? audio_codec_name :
4174.                                      subtitle_codec_name;

ffmpeg.c:4172:5: 
4170.     FILE *f=NULL;
4171.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4172.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4173.                        *opt == 'a' ? audio_codec_name :
4174.                                      subtitle_codec_name;

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

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

ffmpeg.c:4177:9: 
4175. 
4176.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4177.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4178.         ffmpeg_exit(1);
4179.     }

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

ffmpeg.c:4181:12: 
4179.     }
4180. 
4181.     while(!feof(f)){
                 ^
4182.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4183.         if(line[0] == '#' && !e)
