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

ffmpeg.c:1294:1: start of procedure do_video_stats()
1292. }
1293. 
1294. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1295.                            int frame_size)
1296. {

ffmpeg.c:1302:10: Taking true branch
1300. 
1301.     /* this is executed just the first time do_video_stats is called */
1302.     if (!vstats_file) {
               ^
1303.         vstats_file = fopen(vstats_filename, "w");
1304.         if (!vstats_file) {

ffmpeg.c:1303:9: 
1301.     /* this is executed just the first time do_video_stats is called */
1302.     if (!vstats_file) {
1303.         vstats_file = fopen(vstats_filename, "w");
              ^
1304.         if (!vstats_file) {
1305.             perror("fopen");

ffmpeg.c:1304:14: Taking true branch
1302.     if (!vstats_file) {
1303.         vstats_file = fopen(vstats_filename, "w");
1304.         if (!vstats_file) {
                   ^
1305.             perror("fopen");
1306.             ffmpeg_exit(1);

ffmpeg.c:1305:13: 
1303.         vstats_file = fopen(vstats_filename, "w");
1304.         if (!vstats_file) {
1305.             perror("fopen");
                  ^
1306.             ffmpeg_exit(1);
1307.         }

ffmpeg.c:1306:13: Skipping ffmpeg_exit(): empty list of specs
1304.         if (!vstats_file) {
1305.             perror("fopen");
1306.             ffmpeg_exit(1);
                  ^
1307.         }
1308.     }

ffmpeg.c:1310:5: 
1308.     }
1309. 
1310.     enc = ost->st->codec;
          ^
1311.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1312.         frame_number = ost->frame_number;

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

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

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