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

ffmpeg.c:1349:1: start of procedure do_video_stats()
1347. }
1348. 
1349. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1350.                            int frame_size)
1351. {

ffmpeg.c:1357:10: Taking true branch
1355. 
1356.     /* this is executed just the first time do_video_stats is called */
1357.     if (!vstats_file) {
               ^
1358.         vstats_file = fopen(vstats_filename, "w");
1359.         if (!vstats_file) {

ffmpeg.c:1358:9: 
1356.     /* this is executed just the first time do_video_stats is called */
1357.     if (!vstats_file) {
1358.         vstats_file = fopen(vstats_filename, "w");
              ^
1359.         if (!vstats_file) {
1360.             perror("fopen");

ffmpeg.c:1359:14: Taking true branch
1357.     if (!vstats_file) {
1358.         vstats_file = fopen(vstats_filename, "w");
1359.         if (!vstats_file) {
                   ^
1360.             perror("fopen");
1361.             av_exit(1);

ffmpeg.c:1360:13: 
1358.         vstats_file = fopen(vstats_filename, "w");
1359.         if (!vstats_file) {
1360.             perror("fopen");
                  ^
1361.             av_exit(1);
1362.         }

ffmpeg.c:1361:13: Skipping av_exit(): empty list of specs
1359.         if (!vstats_file) {
1360.             perror("fopen");
1361.             av_exit(1);
                  ^
1362.         }
1363.     }

ffmpeg.c:1365:5: 
1363.     }
1364. 
1365.     enc = ost->st->codec;
          ^
1366.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1367.         frame_number = ost->frame_number;

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

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

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