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

ffmpeg.c:1304:1: start of procedure do_video_stats()
1302. }
1303. 
1304. static void do_video_stats(AVFormatContext *os, OutputStream *ost,
      ^
1305.                            int frame_size)
1306. {

ffmpeg.c:1312:10: Taking true branch
1310. 
1311.     /* this is executed just the first time do_video_stats is called */
1312.     if (!vstats_file) {
               ^
1313.         vstats_file = fopen(vstats_filename, "w");
1314.         if (!vstats_file) {

ffmpeg.c:1313:9: 
1311.     /* this is executed just the first time do_video_stats is called */
1312.     if (!vstats_file) {
1313.         vstats_file = fopen(vstats_filename, "w");
              ^
1314.         if (!vstats_file) {
1315.             perror("fopen");

ffmpeg.c:1314:14: Taking true branch
1312.     if (!vstats_file) {
1313.         vstats_file = fopen(vstats_filename, "w");
1314.         if (!vstats_file) {
                   ^
1315.             perror("fopen");
1316.             ffmpeg_exit(1);

ffmpeg.c:1315:13: 
1313.         vstats_file = fopen(vstats_filename, "w");
1314.         if (!vstats_file) {
1315.             perror("fopen");
                  ^
1316.             ffmpeg_exit(1);
1317.         }

ffmpeg.c:1316:13: Skipping ffmpeg_exit(): empty list of specs
1314.         if (!vstats_file) {
1315.             perror("fopen");
1316.             ffmpeg_exit(1);
                  ^
1317.         }
1318.     }

ffmpeg.c:1320:5: 
1318.     }
1319. 
1320.     enc = ost->st->codec;
          ^
1321.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1322.         frame_number = ost->frame_number;

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

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

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