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

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

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

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

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

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

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

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

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

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

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

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

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

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

libavformat/utils.c:2729:5: 
2727.     *ps = NULL;
2728. 
2729.     avio_close(pb);
          ^
2730. }
2731. 

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

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

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