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

ffmpeg.c:4158:1: start of procedure opt_preset()
4156. }
4157. 
4158. static int opt_preset(const char *opt, const char *arg)
      ^
4159. {
4160.     FILE *f=NULL;

ffmpeg.c:4160:5: 
4158. static int opt_preset(const char *opt, const char *arg)
4159. {
4160.     FILE *f=NULL;
          ^
4161.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4162.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4162:24: Condition is false
4160.     FILE *f=NULL;
4161.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4162.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4163.                        *opt == 'a' ? audio_codec_name :
4164.                                      subtitle_codec_name;

ffmpeg.c:4163:24: Condition is false
4161.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4162.     char *codec_name = *opt == 'v' ? video_codec_name :
4163.                        *opt == 'a' ? audio_codec_name :
                             ^
4164.                                      subtitle_codec_name;
4165. 

ffmpeg.c:4162:24: 
4160.     FILE *f=NULL;
4161.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4162.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4163.                        *opt == 'a' ? audio_codec_name :
4164.                                      subtitle_codec_name;

ffmpeg.c:4162:5: 
4160.     FILE *f=NULL;
4161.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4162.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4163.                        *opt == 'a' ? audio_codec_name :
4164.                                      subtitle_codec_name;

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

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

ffmpeg.c:4167:9: 
4165. 
4166.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4167.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4168.         ffmpeg_exit(1);
4169.     }

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

ffmpeg.c:4171:12: 
4169.     }
4170. 
4171.     while(!feof(f)){
                 ^
4172.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4173.         if(line[0] == '#' && !e)
