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

ffmpeg.c:1276:1: start of procedure do_video_stats()
1274. }
1275. 
1276. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
      ^
1277.                            int frame_size)
1278. {

ffmpeg.c:1284:10: Taking true branch
1282. 
1283.     /* this is executed just the first time do_video_stats is called */
1284.     if (!vstats_file) {
               ^
1285.         vstats_file = fopen(vstats_filename, "w");
1286.         if (!vstats_file) {

ffmpeg.c:1285:9: 
1283.     /* this is executed just the first time do_video_stats is called */
1284.     if (!vstats_file) {
1285.         vstats_file = fopen(vstats_filename, "w");
              ^
1286.         if (!vstats_file) {
1287.             perror("fopen");

ffmpeg.c:1286:14: Taking true branch
1284.     if (!vstats_file) {
1285.         vstats_file = fopen(vstats_filename, "w");
1286.         if (!vstats_file) {
                   ^
1287.             perror("fopen");
1288.             ffmpeg_exit(1);

ffmpeg.c:1287:13: 
1285.         vstats_file = fopen(vstats_filename, "w");
1286.         if (!vstats_file) {
1287.             perror("fopen");
                  ^
1288.             ffmpeg_exit(1);
1289.         }

ffmpeg.c:1288:13: Skipping ffmpeg_exit(): empty list of specs
1286.         if (!vstats_file) {
1287.             perror("fopen");
1288.             ffmpeg_exit(1);
                  ^
1289.         }
1290.     }

ffmpeg.c:1292:5: 
1290.     }
1291. 
1292.     enc = ost->st->codec;
          ^
1293.     if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1294.         frame_number = ost->frame_number;

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

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

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