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

libavformat/utils.c:2641:1: start of procedure avformat_close_input()
2639. }
2640. 
2641. void avformat_close_input(AVFormatContext **ps)
      ^
2642. {
2643.     AVFormatContext *s = *ps;

libavformat/utils.c:2643:5: 
2641. void avformat_close_input(AVFormatContext **ps)
2642. {
2643.     AVFormatContext *s = *ps;
          ^
2644.     AVIOContext *pb    = s->pb;
2645. 

libavformat/utils.c:2644:5: 
2642. {
2643.     AVFormatContext *s = *ps;
2644.     AVIOContext *pb    = s->pb;
          ^
2645. 
2646.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2646:10: Taking true branch
2644.     AVIOContext *pb    = s->pb;
2645. 
2646.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2647.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2648.         pb = NULL;

libavformat/utils.c:2646:24: Taking false branch
2644.     AVIOContext *pb    = s->pb;
2645. 
2646.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2647.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2648.         pb = NULL;

libavformat/utils.c:2647:10: Taking true branch
2645. 
2646.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2647.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2648.         pb = NULL;
2649. 

libavformat/utils.c:2648:9: 
2646.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2647.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2648.         pb = NULL;
              ^
2649. 
2650.     flush_packet_queue(s);

libavformat/utils.c:2650:5: Skipping flush_packet_queue(): empty list of specs
2648.         pb = NULL;
2649. 
2650.     flush_packet_queue(s);
          ^
2651. 
2652.     if (s->iformat)

libavformat/utils.c:2652:9: Taking true branch
2650.     flush_packet_queue(s);
2651. 
2652.     if (s->iformat)
              ^
2653.         if (s->iformat->read_close)
2654.             s->iformat->read_close(s);

libavformat/utils.c:2653:13: Taking true branch
2651. 
2652.     if (s->iformat)
2653.         if (s->iformat->read_close)
                  ^
2654.             s->iformat->read_close(s);
2655. 

libavformat/utils.c:2654:13: Skipping __function_pointer__(): unresolved function pointer
2652.     if (s->iformat)
2653.         if (s->iformat->read_close)
2654.             s->iformat->read_close(s);
                  ^
2655. 
2656.     avformat_free_context(s);

libavformat/utils.c:2656:5: Skipping avformat_free_context(): empty list of specs
2654.             s->iformat->read_close(s);
2655. 
2656.     avformat_free_context(s);
          ^
2657. 
2658.     *ps = NULL;

libavformat/utils.c:2658:5: 
2656.     avformat_free_context(s);
2657. 
2658.     *ps = NULL;
          ^
2659. 
2660.     avio_close(pb);

libavformat/utils.c:2660:5: 
2658.     *ps = NULL;
2659. 
2660.     avio_close(pb);
          ^
2661. }
2662. 

libavformat/aviobuf.c:794:1: start of procedure avio_close()
  792. }
  793. 
  794. int avio_close(AVIOContext *s)
       ^
  795. {
  796.     URLContext *h;

libavformat/aviobuf.c:798:10: Taking false branch
  796.     URLContext *h;
  797. 
  798.     if (!s)
                ^
  799.         return 0;
  800. 

libavformat/aviobuf.c:801:5: 
  799.         return 0;
  800. 
  801.     avio_flush(s);
           ^
  802.     h = s->opaque;
  803.     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,
