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

ffmpeg.c:1344:1: start of procedure do_video_stats()
1342. }
1343. 
1344. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1345.                            int frame_size)
1346. {

ffmpeg.c:1352:10: Taking true branch
1350. 
1351.     /* this is executed just the first time do_video_stats is called */
1352.     if (!vstats_file) {
               ^
1353.         vstats_file = fopen(vstats_filename, "w");
1354.         if (!vstats_file) {

ffmpeg.c:1353:9: 
1351.     /* this is executed just the first time do_video_stats is called */
1352.     if (!vstats_file) {
1353.         vstats_file = fopen(vstats_filename, "w");
              ^
1354.         if (!vstats_file) {
1355.             perror("fopen");

ffmpeg.c:1354:14: Taking true branch
1352.     if (!vstats_file) {
1353.         vstats_file = fopen(vstats_filename, "w");
1354.         if (!vstats_file) {
                   ^
1355.             perror("fopen");
1356.             av_exit(1);

ffmpeg.c:1355:13: 
1353.         vstats_file = fopen(vstats_filename, "w");
1354.         if (!vstats_file) {
1355.             perror("fopen");
                  ^
1356.             av_exit(1);
1357.         }

ffmpeg.c:1356:13: Skipping av_exit(): empty list of specs
1354.         if (!vstats_file) {
1355.             perror("fopen");
1356.             av_exit(1);
                  ^
1357.         }
1358.     }

ffmpeg.c:1360:5: 
1358.     }
1359. 
1360.     enc = ost->st->codec;
          ^
1361.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1362.         frame_number = ost->frame_number;

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

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

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