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

ffmpeg.c:4147:1: start of procedure opt_preset()
4145. }
4146. 
4147. static int opt_preset(const char *opt, const char *arg)
      ^
4148. {
4149.     FILE *f=NULL;

ffmpeg.c:4149:5: 
4147. static int opt_preset(const char *opt, const char *arg)
4148. {
4149.     FILE *f=NULL;
          ^
4150.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4151.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4151:24: Condition is false
4149.     FILE *f=NULL;
4150.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4151.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4152.                        *opt == 'a' ? audio_codec_name :
4153.                                      subtitle_codec_name;

ffmpeg.c:4152:24: Condition is false
4150.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4151.     char *codec_name = *opt == 'v' ? video_codec_name :
4152.                        *opt == 'a' ? audio_codec_name :
                             ^
4153.                                      subtitle_codec_name;
4154. 

ffmpeg.c:4151:24: 
4149.     FILE *f=NULL;
4150.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4151.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4152.                        *opt == 'a' ? audio_codec_name :
4153.                                      subtitle_codec_name;

ffmpeg.c:4151:5: 
4149.     FILE *f=NULL;
4150.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4151.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4152.                        *opt == 'a' ? audio_codec_name :
4153.                                      subtitle_codec_name;

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

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

ffmpeg.c:4156:9: 
4154. 
4155.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4156.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4157.         ffmpeg_exit(1);
4158.     }

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

ffmpeg.c:4160:12: 
4158.     }
4159. 
4160.     while(!feof(f)){
                 ^
4161.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4162.         if(line[0] == '#' && !e)
