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

ffmpeg.c:4134:1: start of procedure opt_preset()
4132. }
4133. 
4134. static int opt_preset(const char *opt, const char *arg)
      ^
4135. {
4136.     FILE *f=NULL;

ffmpeg.c:4136:5: 
4134. static int opt_preset(const char *opt, const char *arg)
4135. {
4136.     FILE *f=NULL;
          ^
4137.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4138.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4138:24: Condition is false
4136.     FILE *f=NULL;
4137.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4138.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4139.                        *opt == 'a' ? audio_codec_name :
4140.                                      subtitle_codec_name;

ffmpeg.c:4139:24: Condition is false
4137.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4138.     char *codec_name = *opt == 'v' ? video_codec_name :
4139.                        *opt == 'a' ? audio_codec_name :
                             ^
4140.                                      subtitle_codec_name;
4141. 

ffmpeg.c:4138:24: 
4136.     FILE *f=NULL;
4137.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4138.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4139.                        *opt == 'a' ? audio_codec_name :
4140.                                      subtitle_codec_name;

ffmpeg.c:4138:5: 
4136.     FILE *f=NULL;
4137.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4138.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4139.                        *opt == 'a' ? audio_codec_name :
4140.                                      subtitle_codec_name;

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

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

ffmpeg.c:4143:9: 
4141. 
4142.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4143.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4144.         ffmpeg_exit(1);
4145.     }

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

ffmpeg.c:4147:12: 
4145.     }
4146. 
4147.     while(!feof(f)){
                 ^
4148.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4149.         if(line[0] == '#' && !e)
