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

ffmpeg.c:1253:1: start of procedure do_video_stats()
1251. }
1252. 
1253. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1254.                            int frame_size)
1255. {

ffmpeg.c:1261:10: Taking true branch
1259. 
1260.     /* this is executed just the first time do_video_stats is called */
1261.     if (!vstats_file) {
               ^
1262.         vstats_file = fopen(vstats_filename, "w");
1263.         if (!vstats_file) {

ffmpeg.c:1262:9: 
1260.     /* this is executed just the first time do_video_stats is called */
1261.     if (!vstats_file) {
1262.         vstats_file = fopen(vstats_filename, "w");
              ^
1263.         if (!vstats_file) {
1264.             perror("fopen");

ffmpeg.c:1263:14: Taking true branch
1261.     if (!vstats_file) {
1262.         vstats_file = fopen(vstats_filename, "w");
1263.         if (!vstats_file) {
                   ^
1264.             perror("fopen");
1265.             ffmpeg_exit(1);

ffmpeg.c:1264:13: 
1262.         vstats_file = fopen(vstats_filename, "w");
1263.         if (!vstats_file) {
1264.             perror("fopen");
                  ^
1265.             ffmpeg_exit(1);
1266.         }

ffmpeg.c:1265:13: Skipping ffmpeg_exit(): empty list of specs
1263.         if (!vstats_file) {
1264.             perror("fopen");
1265.             ffmpeg_exit(1);
                  ^
1266.         }
1267.     }

ffmpeg.c:1269:5: 
1267.     }
1268. 
1269.     enc = ost->st->codec;
          ^
1270.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1271.         frame_number = ost->frame_number;

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

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

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