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

ffmpeg.c:4030:1: start of procedure opt_preset()
4028. }
4029. 
4030. static int opt_preset(const char *opt, const char *arg)
      ^
4031. {
4032.     FILE *f=NULL;

ffmpeg.c:4032:5: 
4030. static int opt_preset(const char *opt, const char *arg)
4031. {
4032.     FILE *f=NULL;
          ^
4033.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4034.     char *codec_name = *opt == 'v' ? video_codec_name :

ffmpeg.c:4034:24: Condition is false
4032.     FILE *f=NULL;
4033.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4034.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4035.                        *opt == 'a' ? audio_codec_name :
4036.                                      subtitle_codec_name;

ffmpeg.c:4035:24: Condition is false
4033.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4034.     char *codec_name = *opt == 'v' ? video_codec_name :
4035.                        *opt == 'a' ? audio_codec_name :
                             ^
4036.                                      subtitle_codec_name;
4037. 

ffmpeg.c:4034:24: 
4032.     FILE *f=NULL;
4033.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4034.     char *codec_name = *opt == 'v' ? video_codec_name :
                             ^
4035.                        *opt == 'a' ? audio_codec_name :
4036.                                      subtitle_codec_name;

ffmpeg.c:4034:5: 
4032.     FILE *f=NULL;
4033.     char filename[1000], tmp[1000], tmp2[1000], line[1000];
4034.     char *codec_name = *opt == 'v' ? video_codec_name :
          ^
4035.                        *opt == 'a' ? audio_codec_name :
4036.                                      subtitle_codec_name;

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

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

ffmpeg.c:4039:9: 
4037. 
4038.     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
4039.         fprintf(stderr, "File for preset '%s' not found\n", arg);
              ^
4040.         ffmpeg_exit(1);
4041.     }

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

ffmpeg.c:4043:12: 
4041.     }
4042. 
4043.     while(!feof(f)){
                 ^
4044.         int e= fscanf(f, "%999[^\n]\n", line) - 1;
4045.         if(line[0] == '#' && !e)
