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

ffmpeg.c:1300:1: start of procedure do_video_stats()
1298. }
1299. 
1300. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1301.                            int frame_size)
1302. {

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

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

ffmpeg.c:1310:14: Taking true branch
1308.     if (!vstats_file) {
1309.         vstats_file = fopen(vstats_filename, "w");
1310.         if (!vstats_file) {
                   ^
1311.             perror("fopen");
1312.             ffmpeg_exit(1);

ffmpeg.c:1311:13: 
1309.         vstats_file = fopen(vstats_filename, "w");
1310.         if (!vstats_file) {
1311.             perror("fopen");
                  ^
1312.             ffmpeg_exit(1);
1313.         }

ffmpeg.c:1312:13: Skipping ffmpeg_exit(): empty list of specs
1310.         if (!vstats_file) {
1311.             perror("fopen");
1312.             ffmpeg_exit(1);
                  ^
1313.         }
1314.     }

ffmpeg.c:1316:5: 
1314.     }
1315. 
1316.     enc = ost->st->codec;
          ^
1317.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1318.         frame_number = ost->frame_number;

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

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

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