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

ffmpeg.c:1014:1: start of procedure do_video_stats()
1012. }
1013. 
1014. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1015.                            int frame_size)
1016. {

ffmpeg.c:1022:10: Taking true branch
1020. 
1021.     /* this is executed just the first time do_video_stats is called */
1022.     if (!vstats_file) {
               ^
1023.         vstats_file = fopen(vstats_filename, "w");
1024.         if (!vstats_file) {

ffmpeg.c:1023:9: 
1021.     /* this is executed just the first time do_video_stats is called */
1022.     if (!vstats_file) {
1023.         vstats_file = fopen(vstats_filename, "w");
              ^
1024.         if (!vstats_file) {
1025.             perror("fopen");

ffmpeg.c:1024:14: Taking true branch
1022.     if (!vstats_file) {
1023.         vstats_file = fopen(vstats_filename, "w");
1024.         if (!vstats_file) {
                   ^
1025.             perror("fopen");
1026.             av_exit(1);

ffmpeg.c:1025:13: 
1023.         vstats_file = fopen(vstats_filename, "w");
1024.         if (!vstats_file) {
1025.             perror("fopen");
                  ^
1026.             av_exit(1);
1027.         }

ffmpeg.c:1026:13: Skipping av_exit(): empty list of specs
1024.         if (!vstats_file) {
1025.             perror("fopen");
1026.             av_exit(1);
                  ^
1027.         }
1028.     }

ffmpeg.c:1030:5: 
1028.     }
1029. 
1030.     enc = ost->st->codec;
          ^
1031.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
1032.         frame_number = ost->frame_number;

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

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

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