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

libavformat/utils.c:2706:1: start of procedure avformat_close_input()
2704. #endif
2705. 
2706. void avformat_close_input(AVFormatContext **ps)
      ^
2707. {
2708.     AVFormatContext *s = *ps;

libavformat/utils.c:2708:5: 
2706. void avformat_close_input(AVFormatContext **ps)
2707. {
2708.     AVFormatContext *s = *ps;
          ^
2709.     AVIOContext *pb = s->pb;
2710. 

libavformat/utils.c:2709:5: 
2707. {
2708.     AVFormatContext *s = *ps;
2709.     AVIOContext *pb = s->pb;
          ^
2710. 
2711.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2711:10: Taking true branch
2709.     AVIOContext *pb = s->pb;
2710. 
2711.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2712.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2713.         pb = NULL;

libavformat/utils.c:2711:24: Taking false branch
2709.     AVIOContext *pb = s->pb;
2710. 
2711.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2712.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2713.         pb = NULL;

libavformat/utils.c:2712:10: Taking true branch
2710. 
2711.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2712.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2713.         pb = NULL;
2714. 

libavformat/utils.c:2713:9: 
2711.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2712.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2713.         pb = NULL;
              ^
2714. 
2715.     flush_packet_queue(s);

libavformat/utils.c:2715:5: Skipping flush_packet_queue(): empty list of specs
2713.         pb = NULL;
2714. 
2715.     flush_packet_queue(s);
          ^
2716. 
2717.     if (s->iformat) {

libavformat/utils.c:2717:9: Taking true branch
2715.     flush_packet_queue(s);
2716. 
2717.     if (s->iformat) {
              ^
2718.         if (s->iformat->read_close)
2719.             s->iformat->read_close(s);

libavformat/utils.c:2718:13: Taking true branch
2716. 
2717.     if (s->iformat) {
2718.         if (s->iformat->read_close)
                  ^
2719.             s->iformat->read_close(s);
2720.     }

libavformat/utils.c:2719:13: Skipping __function_pointer__(): unresolved function pointer
2717.     if (s->iformat) {
2718.         if (s->iformat->read_close)
2719.             s->iformat->read_close(s);
                  ^
2720.     }
2721. 

libavformat/utils.c:2722:5: Skipping avformat_free_context(): empty list of specs
2720.     }
2721. 
2722.     avformat_free_context(s);
          ^
2723. 
2724.     *ps = NULL;

libavformat/utils.c:2724:5: 
2722.     avformat_free_context(s);
2723. 
2724.     *ps = NULL;
          ^
2725. 
2726.     avio_close(pb);

libavformat/utils.c:2726:5: 
2724.     *ps = NULL;
2725. 
2726.     avio_close(pb);
          ^
2727. }
2728. 

libavformat/aviobuf.c:768:1: start of procedure avio_close()
  766. }
  767. 
  768. int avio_close(AVIOContext *s)
       ^
  769. {
  770.     URLContext *h;

libavformat/aviobuf.c:772:10: Taking false branch
  770.     URLContext *h;
  771. 
  772.     if (!s)
                ^
  773.         return 0;
  774. 

libavformat/aviobuf.c:775:5: 
  773.         return 0;
  774. 
  775.     avio_flush(s);
           ^
  776.     h = s->opaque;
  777.     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,
