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

ffmpeg.c:4154:1: start of procedure opt_preset()
4152. }
4153. 
4154. static int opt_preset(const char *opt, const char *arg)
      ^
4155. {
4156.     FILE *f=NULL;

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

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

ffmpeg.c:4159:24: Condition is false
4157.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4158.     char *codec_name = *opt == 'v' ? video_codec_name :
4159.                        *opt == 'a' ? audio_codec_name :
                             ^
4160.                                      subtitle_codec_name;
4161. 

ffmpeg.c:4158:24: 
4156.     FILE *f=NULL;
4157.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4158.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4159.                        *opt == 'a' ? audio_codec_name :
4160.                                      subtitle_codec_name;

ffmpeg.c:4158:5: 
4156.     FILE *f=NULL;
4157.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4158.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4159.                        *opt == 'a' ? audio_codec_name :
4160.                                      subtitle_codec_name;

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

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

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

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

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