ffmpeg.c:1194: error: Null Dereference
  pointer `vstats_file` last assigned on line 1184 could be null and is dereferenced by call to `fprintf()` at line 1194, column 9.

ffmpeg.c:1175:1: start of procedure do_video_stats()
1173. }
1174. 
1175. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1176.                            int frame_size)
1177. {

ffmpeg.c:1183:10: Taking true branch
1181. 
1182.     /* this is executed just the first time do_video_stats is called */
1183.     if (!vstats_file) {
               ^
1184.         vstats_file = fopen(vstats_filename, "w");
1185.         if (!vstats_file) {

ffmpeg.c:1184:9: 
1182.     /* this is executed just the first time do_video_stats is called */
1183.     if (!vstats_file) {
1184.         vstats_file = fopen(vstats_filename, "w");
              ^
1185.         if (!vstats_file) {
1186.             perror("fopen");

ffmpeg.c:1185:14: Taking true branch
1183.     if (!vstats_file) {
1184.         vstats_file = fopen(vstats_filename, "w");
1185.         if (!vstats_file) {
                   ^
1186.             perror("fopen");
1187.             av_exit(1);

ffmpeg.c:1186:13: 
1184.         vstats_file = fopen(vstats_filename, "w");
1185.         if (!vstats_file) {
1186.             perror("fopen");
                  ^
1187.             av_exit(1);
1188.         }

ffmpeg.c:1187:13: Skipping av_exit(): empty list of specs
1185.         if (!vstats_file) {
1186.             perror("fopen");
1187.             av_exit(1);
                  ^
1188.         }
1189.     }

ffmpeg.c:1191:5: 
1189.     }
1190. 
1191.     enc = ost->st->codec;
          ^
1192.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1193.         frame_number = ost->frame_number;

ffmpeg.c:1192:9: Taking true branch
1190. 
1191.     enc = ost->st->codec;
1192.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
              ^
1193.         frame_number = ost->frame_number;
1194.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);

ffmpeg.c:1193:9: 
1191.     enc = ost->st->codec;
1192.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1193.         frame_number = ost->frame_number;
              ^
1194.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
1195.         if (enc->flags&CODEC_FLAG_PSNR)

ffmpeg.c:1194:9: 
1192.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1193.         frame_number = ost->frame_number;
1194.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
              ^
1195.         if (enc->flags&CODEC_FLAG_PSNR)
1196.             fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
