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

libavformat/utils.c:2624:1: start of procedure avformat_close_input()
2622. }
2623. 
2624. void avformat_close_input(AVFormatContext **ps)
      ^
2625. {
2626.     AVFormatContext *s = *ps;

libavformat/utils.c:2626:5: 
2624. void avformat_close_input(AVFormatContext **ps)
2625. {
2626.     AVFormatContext *s = *ps;
          ^
2627.     AVIOContext *pb    = s->pb;
2628. 

libavformat/utils.c:2627:5: 
2625. {
2626.     AVFormatContext *s = *ps;
2627.     AVIOContext *pb    = s->pb;
          ^
2628. 
2629.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2629:10: Taking true branch
2627.     AVIOContext *pb    = s->pb;
2628. 
2629.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2630.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2631.         pb = NULL;

libavformat/utils.c:2629:24: Taking false branch
2627.     AVIOContext *pb    = s->pb;
2628. 
2629.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2630.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2631.         pb = NULL;

libavformat/utils.c:2630:10: Taking true branch
2628. 
2629.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2630.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2631.         pb = NULL;
2632. 

libavformat/utils.c:2631:9: 
2629.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2630.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2631.         pb = NULL;
              ^
2632. 
2633.     flush_packet_queue(s);

libavformat/utils.c:2633:5: Skipping flush_packet_queue(): empty list of specs
2631.         pb = NULL;
2632. 
2633.     flush_packet_queue(s);
          ^
2634. 
2635.     if (s->iformat)

libavformat/utils.c:2635:9: Taking true branch
2633.     flush_packet_queue(s);
2634. 
2635.     if (s->iformat)
              ^
2636.         if (s->iformat->read_close)
2637.             s->iformat->read_close(s);

libavformat/utils.c:2636:13: Taking true branch
2634. 
2635.     if (s->iformat)
2636.         if (s->iformat->read_close)
                  ^
2637.             s->iformat->read_close(s);
2638. 

libavformat/utils.c:2637:13: Skipping __function_pointer__(): unresolved function pointer
2635.     if (s->iformat)
2636.         if (s->iformat->read_close)
2637.             s->iformat->read_close(s);
                  ^
2638. 
2639.     avformat_free_context(s);

libavformat/utils.c:2639:5: Skipping avformat_free_context(): empty list of specs
2637.             s->iformat->read_close(s);
2638. 
2639.     avformat_free_context(s);
          ^
2640. 
2641.     *ps = NULL;

libavformat/utils.c:2641:5: 
2639.     avformat_free_context(s);
2640. 
2641.     *ps = NULL;
          ^
2642. 
2643.     avio_close(pb);

libavformat/utils.c:2643:5: 
2641.     *ps = NULL;
2642. 
2643.     avio_close(pb);
          ^
2644. }
2645. 

libavformat/aviobuf.c:800:1: start of procedure avio_close()
  798. }
  799. 
  800. int avio_close(AVIOContext *s)
       ^
  801. {
  802.     URLContext *h;

libavformat/aviobuf.c:804:10: Taking false branch
  802.     URLContext *h;
  803. 
  804.     if (!s)
                ^
  805.         return 0;
  806. 

libavformat/aviobuf.c:807:5: 
  805.         return 0;
  806. 
  807.     avio_flush(s);
           ^
  808.     h = s->opaque;
  809.     av_freep(&s->buffer);

libavformat/aviobuf.c:180:1: start of procedure avio_flush()
    178. }
    179. 
    180. void avio_flush(AVIOContext *s)
         ^
    181. {
    182.     flush_buffer(s);

libavformat/aviobuf.c:182:5: 
    180. void avio_flush(AVIOContext *s)
    181. {
    182.     flush_buffer(s);
             ^
    183.     s->must_flush = 0;
    184. }

libavformat/aviobuf.c:124:1: start of procedure flush_buffer()
      122. }
      123. 
      124. static void flush_buffer(AVIOContext *s)
           ^
      125. {
      126.     if (s->buf_ptr > s->buffer) {

libavformat/aviobuf.c:126:9: 
      124. static void flush_buffer(AVIOContext *s)
      125. {
      126.     if (s->buf_ptr > s->buffer) {
                   ^
      127.         if (s->write_packet && !s->error) {
      128.             int ret = s->write_packet(s->opaque, s->buffer,
