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

ffmpeg.c:1356:1: start of procedure do_video_stats()
1354. }
1355. 
1356. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1357.                            int frame_size)
1358. {

ffmpeg.c:1364:10: Taking true branch
1362. 
1363.     /* this is executed just the first time do_video_stats is called */
1364.     if (!vstats_file) {
               ^
1365.         vstats_file = fopen(vstats_filename, "w");
1366.         if (!vstats_file) {

ffmpeg.c:1365:9: 
1363.     /* this is executed just the first time do_video_stats is called */
1364.     if (!vstats_file) {
1365.         vstats_file = fopen(vstats_filename, "w");
              ^
1366.         if (!vstats_file) {
1367.             perror("fopen");

ffmpeg.c:1366:14: Taking true branch
1364.     if (!vstats_file) {
1365.         vstats_file = fopen(vstats_filename, "w");
1366.         if (!vstats_file) {
                   ^
1367.             perror("fopen");
1368.             av_exit(1);

ffmpeg.c:1367:13: 
1365.         vstats_file = fopen(vstats_filename, "w");
1366.         if (!vstats_file) {
1367.             perror("fopen");
                  ^
1368.             av_exit(1);
1369.         }

ffmpeg.c:1368:13: Skipping av_exit(): empty list of specs
1366.         if (!vstats_file) {
1367.             perror("fopen");
1368.             av_exit(1);
                  ^
1369.         }
1370.     }

ffmpeg.c:1372:5: 
1370.     }
1371. 
1372.     enc = ost->st->codec;
          ^
1373.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1374.         frame_number = ost->frame_number;

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

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

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