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

ffmpeg.c:1106:1: start of procedure do_video_stats()
1104. }
1105. 
1106. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1107.                            int frame_size)
1108. {

ffmpeg.c:1114:10: Taking true branch
1112. 
1113.     /* this is executed just the first time do_video_stats is called */
1114.     if (!vstats_file) {
               ^
1115.         vstats_file = fopen(vstats_filename, "w");
1116.         if (!vstats_file) {

ffmpeg.c:1115:9: 
1113.     /* this is executed just the first time do_video_stats is called */
1114.     if (!vstats_file) {
1115.         vstats_file = fopen(vstats_filename, "w");
              ^
1116.         if (!vstats_file) {
1117.             perror("fopen");

ffmpeg.c:1116:14: Taking true branch
1114.     if (!vstats_file) {
1115.         vstats_file = fopen(vstats_filename, "w");
1116.         if (!vstats_file) {
                   ^
1117.             perror("fopen");
1118.             av_exit(1);

ffmpeg.c:1117:13: 
1115.         vstats_file = fopen(vstats_filename, "w");
1116.         if (!vstats_file) {
1117.             perror("fopen");
                  ^
1118.             av_exit(1);
1119.         }

ffmpeg.c:1118:13: Skipping av_exit(): empty list of specs
1116.         if (!vstats_file) {
1117.             perror("fopen");
1118.             av_exit(1);
                  ^
1119.         }
1120.     }

ffmpeg.c:1122:5: 
1120.     }
1121. 
1122.     enc = ost->st->codec;
          ^
1123.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
1124.         frame_number = ost->frame_number;

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

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

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