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

ffmpeg.c:1116:1: start of procedure do_video_stats()
1114. }
1115. 
1116. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1117.                            int frame_size)
1118. {

ffmpeg.c:1124:10: Taking true branch
1122. 
1123.     /* this is executed just the first time do_video_stats is called */
1124.     if (!vstats_file) {
               ^
1125.         vstats_file = fopen(vstats_filename, "w");
1126.         if (!vstats_file) {

ffmpeg.c:1125:9: 
1123.     /* this is executed just the first time do_video_stats is called */
1124.     if (!vstats_file) {
1125.         vstats_file = fopen(vstats_filename, "w");
              ^
1126.         if (!vstats_file) {
1127.             perror("fopen");

ffmpeg.c:1126:14: Taking true branch
1124.     if (!vstats_file) {
1125.         vstats_file = fopen(vstats_filename, "w");
1126.         if (!vstats_file) {
                   ^
1127.             perror("fopen");
1128.             av_exit(1);

ffmpeg.c:1127:13: 
1125.         vstats_file = fopen(vstats_filename, "w");
1126.         if (!vstats_file) {
1127.             perror("fopen");
                  ^
1128.             av_exit(1);
1129.         }

ffmpeg.c:1128:13: Skipping av_exit(): empty list of specs
1126.         if (!vstats_file) {
1127.             perror("fopen");
1128.             av_exit(1);
                  ^
1129.         }
1130.     }

ffmpeg.c:1132:5: 
1130.     }
1131. 
1132.     enc = ost->st->codec;
          ^
1133.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
1134.         frame_number = ost->frame_number;

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

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

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