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

ffmpeg.c:1083:1: start of procedure do_video_stats()
1081. }
1082. 
1083. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1084.                            int frame_size)
1085. {

ffmpeg.c:1091:10: Taking true branch
1089. 
1090.     /* this is executed just the first time do_video_stats is called */
1091.     if (!vstats_file) {
               ^
1092.         vstats_file = fopen(vstats_filename, "w");
1093.         if (!vstats_file) {

ffmpeg.c:1092:9: 
1090.     /* this is executed just the first time do_video_stats is called */
1091.     if (!vstats_file) {
1092.         vstats_file = fopen(vstats_filename, "w");
              ^
1093.         if (!vstats_file) {
1094.             perror("fopen");

ffmpeg.c:1093:14: Taking true branch
1091.     if (!vstats_file) {
1092.         vstats_file = fopen(vstats_filename, "w");
1093.         if (!vstats_file) {
                   ^
1094.             perror("fopen");
1095.             av_exit(1);

ffmpeg.c:1094:13: 
1092.         vstats_file = fopen(vstats_filename, "w");
1093.         if (!vstats_file) {
1094.             perror("fopen");
                  ^
1095.             av_exit(1);
1096.         }

ffmpeg.c:1095:13: Skipping av_exit(): empty list of specs
1093.         if (!vstats_file) {
1094.             perror("fopen");
1095.             av_exit(1);
                  ^
1096.         }
1097.     }

ffmpeg.c:1099:5: 
1097.     }
1098. 
1099.     enc = ost->st->codec;
          ^
1100.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
1101.         frame_number = ost->frame_number;

ffmpeg.c:1100:9: Taking true branch
1098. 
1099.     enc = ost->st->codec;
1100.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
              ^
1101.         frame_number = ost->frame_number;
1102.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);

ffmpeg.c:1101:9: 
1099.     enc = ost->st->codec;
1100.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
1101.         frame_number = ost->frame_number;
              ^
1102.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
1103.         if (enc->flags&CODEC_FLAG_PSNR)

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