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

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

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

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

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

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

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

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

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

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

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

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