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

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

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

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

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

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

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

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

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

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

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

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

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

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

libavformat/utils.c:2696:5: 
2694.     *ps = NULL;
2695. 
2696.     avio_close(pb);
          ^
2697. }
2698. 

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

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

libavformat/aviobuf.c:762:5: 
  760.         return 0;
  761. 
  762.     avio_flush(s);
           ^
  763.     h = s->opaque;
  764.     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);
