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

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

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

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

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

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

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

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

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

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

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