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

ffmpeg.c:1251:1: start of procedure do_video_stats()
1249. }
1250. 
1251. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1252.                            int frame_size)
1253. {

ffmpeg.c:1259:10: Taking true branch
1257. 
1258.     /* this is executed just the first time do_video_stats is called */
1259.     if (!vstats_file) {
               ^
1260.         vstats_file = fopen(vstats_filename, "w");
1261.         if (!vstats_file) {

ffmpeg.c:1260:9: 
1258.     /* this is executed just the first time do_video_stats is called */
1259.     if (!vstats_file) {
1260.         vstats_file = fopen(vstats_filename, "w");
              ^
1261.         if (!vstats_file) {
1262.             perror("fopen");

ffmpeg.c:1261:14: Taking true branch
1259.     if (!vstats_file) {
1260.         vstats_file = fopen(vstats_filename, "w");
1261.         if (!vstats_file) {
                   ^
1262.             perror("fopen");
1263.             ffmpeg_exit(1);

ffmpeg.c:1262:13: 
1260.         vstats_file = fopen(vstats_filename, "w");
1261.         if (!vstats_file) {
1262.             perror("fopen");
                  ^
1263.             ffmpeg_exit(1);
1264.         }

ffmpeg.c:1263:13: Skipping ffmpeg_exit(): empty list of specs
1261.         if (!vstats_file) {
1262.             perror("fopen");
1263.             ffmpeg_exit(1);
                  ^
1264.         }
1265.     }

ffmpeg.c:1267:5: 
1265.     }
1266. 
1267.     enc = ost->st->codec;
          ^
1268.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1269.         frame_number = ost->frame_number;

ffmpeg.c:1268:9: Taking true branch
1266. 
1267.     enc = ost->st->codec;
1268.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
              ^
1269.         frame_number = ost->frame_number;
1270.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);

ffmpeg.c:1269:9: 
1267.     enc = ost->st->codec;
1268.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1269.         frame_number = ost->frame_number;
              ^
1270.         fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
1271.         if (enc->flags&CODEC_FLAG_PSNR)

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