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

ffmpeg.c:1340:1: start of procedure do_video_stats()
1338. }
1339. 
1340. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1341.                            int frame_size)
1342. {

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

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

ffmpeg.c:1350:14: Taking true branch
1348.     if (!vstats_file) {
1349.         vstats_file = fopen(vstats_filename, "w");
1350.         if (!vstats_file) {
                   ^
1351.             perror("fopen");
1352.             ffmpeg_exit(1);

ffmpeg.c:1351:13: 
1349.         vstats_file = fopen(vstats_filename, "w");
1350.         if (!vstats_file) {
1351.             perror("fopen");
                  ^
1352.             ffmpeg_exit(1);
1353.         }

ffmpeg.c:1352:13: Skipping ffmpeg_exit(): empty list of specs
1350.         if (!vstats_file) {
1351.             perror("fopen");
1352.             ffmpeg_exit(1);
                  ^
1353.         }
1354.     }

ffmpeg.c:1356:5: 
1354.     }
1355. 
1356.     enc = ost->st->codec;
          ^
1357.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1358.         frame_number = ost->frame_number;

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

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

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