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

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

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

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

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

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

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

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

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

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

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