libavformat/utils.c:2693: error: Null Dereference
  pointer `pb` last assigned on line 2680 could be null and is dereferenced by call to `avio_close()` at line 2693, column 5.

libavformat/utils.c:2673:1: start of procedure avformat_close_input()
2671. #endif
2672. 
2673. void avformat_close_input(AVFormatContext **ps)
      ^
2674. {
2675.     AVFormatContext *s = *ps;

libavformat/utils.c:2675:5: 
2673. void avformat_close_input(AVFormatContext **ps)
2674. {
2675.     AVFormatContext *s = *ps;
          ^
2676.     AVIOContext *pb = s->pb;
2677. 

libavformat/utils.c:2676:5: 
2674. {
2675.     AVFormatContext *s = *ps;
2676.     AVIOContext *pb = s->pb;
          ^
2677. 
2678.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2678:10: Taking true branch
2676.     AVIOContext *pb = s->pb;
2677. 
2678.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2679.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2680.         pb = NULL;

libavformat/utils.c:2678:24: Taking false branch
2676.     AVIOContext *pb = s->pb;
2677. 
2678.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2679.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2680.         pb = NULL;

libavformat/utils.c:2679:10: Taking true branch
2677. 
2678.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2679.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2680.         pb = NULL;
2681. 

libavformat/utils.c:2680:9: 
2678.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2679.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2680.         pb = NULL;
              ^
2681. 
2682.     flush_packet_queue(s);

libavformat/utils.c:2682:5: Skipping flush_packet_queue(): empty list of specs
2680.         pb = NULL;
2681. 
2682.     flush_packet_queue(s);
          ^
2683. 
2684.     if (s->iformat) {

libavformat/utils.c:2684:9: Taking true branch
2682.     flush_packet_queue(s);
2683. 
2684.     if (s->iformat) {
              ^
2685.         if (s->iformat->read_close)
2686.             s->iformat->read_close(s);

libavformat/utils.c:2685:13: Taking true branch
2683. 
2684.     if (s->iformat) {
2685.         if (s->iformat->read_close)
                  ^
2686.             s->iformat->read_close(s);
2687.     }

libavformat/utils.c:2686:13: Skipping __function_pointer__(): unresolved function pointer
2684.     if (s->iformat) {
2685.         if (s->iformat->read_close)
2686.             s->iformat->read_close(s);
                  ^
2687.     }
2688. 

libavformat/utils.c:2689:5: Skipping avformat_free_context(): empty list of specs
2687.     }
2688. 
2689.     avformat_free_context(s);
          ^
2690. 
2691.     *ps = NULL;

libavformat/utils.c:2691:5: 
2689.     avformat_free_context(s);
2690. 
2691.     *ps = NULL;
          ^
2692. 
2693.     avio_close(pb);

libavformat/utils.c:2693:5: 
2691.     *ps = NULL;
2692. 
2693.     avio_close(pb);
          ^
2694. }
2695. 

libavformat/aviobuf.c:757:1: start of procedure avio_close()
  755. }
  756. 
  757. int avio_close(AVIOContext *s)
       ^
  758. {
  759.     URLContext *h;

libavformat/aviobuf.c:761:10: Taking false branch
  759.     URLContext *h;
  760. 
  761.     if (!s)
                ^
  762.         return 0;
  763. 

libavformat/aviobuf.c:764:5: 
  762.         return 0;
  763. 
  764.     avio_flush(s);
           ^
  765.     h = s->opaque;
  766.     av_freep(&s->buffer);

libavformat/aviobuf.c:174:1: start of procedure avio_flush()
    172. }
    173. 
    174. void avio_flush(AVIOContext *s)
         ^
    175. {
    176.     flush_buffer(s);

libavformat/aviobuf.c:176:5: 
    174. void avio_flush(AVIOContext *s)
    175. {
    176.     flush_buffer(s);
             ^
    177.     s->must_flush = 0;
    178. }

libavformat/aviobuf.c:120:1: start of procedure flush_buffer()
      118. }
      119. 
      120. static void flush_buffer(AVIOContext *s)
           ^
      121. {
      122.     if (s->buf_ptr > s->buffer) {

libavformat/aviobuf.c:122:9: 
      120. static void flush_buffer(AVIOContext *s)
      121. {
      122.     if (s->buf_ptr > s->buffer) {
                   ^
      123.         if (s->write_packet && !s->error){
      124.             int ret= s->write_packet(s->opaque, s->buffer, s->buf_ptr - s->buffer);
