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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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,
