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

ffmpeg.c:4114:1: start of procedure opt_preset()
4112. }
4113. 
4114. static int opt_preset(const char *opt, const char *arg)
      ^
4115. {
4116.     FILE *f=NULL;

ffmpeg.c:4116:5: 
4114. static int opt_preset(const char *opt, const char *arg)
4115. {
4116.     FILE *f=NULL;
          ^
4117.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4118.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4118:24: Condition is false
4116.     FILE *f=NULL;
4117.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4118.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4119.                        *opt == 'a' ? audio_codec_name :
4120.                                      subtitle_codec_name;

ffmpeg.c:4119:24: Condition is false
4117.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4118.     char *codec_name = *opt == 'v' ? video_codec_name :
4119.                        *opt == 'a' ? audio_codec_name :
                             ^
4120.                                      subtitle_codec_name;
4121. 

ffmpeg.c:4118:24: 
4116.     FILE *f=NULL;
4117.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4118.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4119.                        *opt == 'a' ? audio_codec_name :
4120.                                      subtitle_codec_name;

ffmpeg.c:4118:5: 
4116.     FILE *f=NULL;
4117.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4118.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4119.                        *opt == 'a' ? audio_codec_name :
4120.                                      subtitle_codec_name;

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

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

ffmpeg.c:4123:9: 
4121. 
4122.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4123.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4124.         ffmpeg_exit(1);
4125.     }

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

ffmpeg.c:4127:12: 
4125.     }
4126. 
4127.     while(!feof(f)){
                 ^
4128.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4129.         if(line[0] == '#' && !e)
