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

ffmpeg.c:933:1: start of procedure do_video_stats()
931. }
932. 
933. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
     ^
934.                            int frame_size)
935. {

ffmpeg.c:941:10: Taking true branch
939. 
940.     /* this is executed just the first time do_video_stats is called */
941.     if (!vstats_file) {
              ^
942.         vstats_file = fopen(vstats_filename, "w");
943.         if (!vstats_file) {

ffmpeg.c:942:9: 
940.     /* this is executed just the first time do_video_stats is called */
941.     if (!vstats_file) {
942.         vstats_file = fopen(vstats_filename, "w");
             ^
943.         if (!vstats_file) {
944.             perror("fopen");

ffmpeg.c:943:14: Taking true branch
941.     if (!vstats_file) {
942.         vstats_file = fopen(vstats_filename, "w");
943.         if (!vstats_file) {
                  ^
944.             perror("fopen");
945.             av_exit(1);

ffmpeg.c:944:13: 
942.         vstats_file = fopen(vstats_filename, "w");
943.         if (!vstats_file) {
944.             perror("fopen");
                 ^
945.             av_exit(1);
946.         }

ffmpeg.c:945:13: Skipping av_exit(): empty list of specs
943.         if (!vstats_file) {
944.             perror("fopen");
945.             av_exit(1);
                 ^
946.         }
947.     }

ffmpeg.c:949:5: 
947.     }
948. 
949.     enc = ost->st->codec;
         ^
950.     if (enc->codec_type == CODEC_TYPE_VIDEO) {
951.         frame_number = ost->frame_number;

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

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

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