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

ffmpeg.c:4142:1: start of procedure opt_preset()
4140. }
4141. 
4142. static int opt_preset(const char *opt, const char *arg)
      ^
4143. {
4144.     FILE *f=NULL;

ffmpeg.c:4144:5: 
4142. static int opt_preset(const char *opt, const char *arg)
4143. {
4144.     FILE *f=NULL;
          ^
4145.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4146.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4146:24: Condition is false
4144.     FILE *f=NULL;
4145.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4146.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4147.                        *opt == 'a' ? audio_codec_name :
4148.                                      subtitle_codec_name;

ffmpeg.c:4147:24: Condition is false
4145.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4146.     char *codec_name = *opt == 'v' ? video_codec_name :
4147.                        *opt == 'a' ? audio_codec_name :
                             ^
4148.                                      subtitle_codec_name;
4149. 

ffmpeg.c:4146:24: 
4144.     FILE *f=NULL;
4145.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4146.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4147.                        *opt == 'a' ? audio_codec_name :
4148.                                      subtitle_codec_name;

ffmpeg.c:4146:5: 
4144.     FILE *f=NULL;
4145.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4146.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4147.                        *opt == 'a' ? audio_codec_name :
4148.                                      subtitle_codec_name;

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

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

ffmpeg.c:4151:9: 
4149. 
4150.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4151.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4152.         ffmpeg_exit(1);
4153.     }

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

ffmpeg.c:4155:12: 
4153.     }
4154. 
4155.     while(!feof(f)){
                 ^
4156.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4157.         if(line[0] == '#' && !e)
