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

ffmpeg.c:1286:1: start of procedure do_video_stats()
1284. }
1285. 
1286. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1287.                            int frame_size)
1288. {

ffmpeg.c:1294:10: Taking true branch
1292. 
1293.     /* this is executed just the first time do_video_stats is called */
1294.     if (!vstats_file) {
               ^
1295.         vstats_file = fopen(vstats_filename, "w");
1296.         if (!vstats_file) {

ffmpeg.c:1295:9: 
1293.     /* this is executed just the first time do_video_stats is called */
1294.     if (!vstats_file) {
1295.         vstats_file = fopen(vstats_filename, "w");
              ^
1296.         if (!vstats_file) {
1297.             perror("fopen");

ffmpeg.c:1296:14: Taking true branch
1294.     if (!vstats_file) {
1295.         vstats_file = fopen(vstats_filename, "w");
1296.         if (!vstats_file) {
                   ^
1297.             perror("fopen");
1298.             ffmpeg_exit(1);

ffmpeg.c:1297:13: 
1295.         vstats_file = fopen(vstats_filename, "w");
1296.         if (!vstats_file) {
1297.             perror("fopen");
                  ^
1298.             ffmpeg_exit(1);
1299.         }

ffmpeg.c:1298:13: Skipping ffmpeg_exit(): empty list of specs
1296.         if (!vstats_file) {
1297.             perror("fopen");
1298.             ffmpeg_exit(1);
                  ^
1299.         }
1300.     }

ffmpeg.c:1302:5: 
1300.     }
1301. 
1302.     enc = ost->st->codec;
          ^
1303.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1304.         frame_number = ost->frame_number;

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

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

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