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

ffmpeg.c:1236:1: start of procedure do_video_stats()
1234. }
1235. 
1236. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1237.                            int frame_size)
1238. {

ffmpeg.c:1244:10: Taking true branch
1242. 
1243.     /* this is executed just the first time do_video_stats is called */
1244.     if (!vstats_file) {
               ^
1245.         vstats_file = fopen(vstats_filename, "w");
1246.         if (!vstats_file) {

ffmpeg.c:1245:9: 
1243.     /* this is executed just the first time do_video_stats is called */
1244.     if (!vstats_file) {
1245.         vstats_file = fopen(vstats_filename, "w");
              ^
1246.         if (!vstats_file) {
1247.             perror("fopen");

ffmpeg.c:1246:14: Taking true branch
1244.     if (!vstats_file) {
1245.         vstats_file = fopen(vstats_filename, "w");
1246.         if (!vstats_file) {
                   ^
1247.             perror("fopen");
1248.             ffmpeg_exit(1);

ffmpeg.c:1247:13: 
1245.         vstats_file = fopen(vstats_filename, "w");
1246.         if (!vstats_file) {
1247.             perror("fopen");
                  ^
1248.             ffmpeg_exit(1);
1249.         }

ffmpeg.c:1248:13: Skipping ffmpeg_exit(): empty list of specs
1246.         if (!vstats_file) {
1247.             perror("fopen");
1248.             ffmpeg_exit(1);
                  ^
1249.         }
1250.     }

ffmpeg.c:1252:5: 
1250.     }
1251. 
1252.     enc = ost->st->codec;
          ^
1253.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1254.         frame_number = ost->frame_number;

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

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

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