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

libavformat/utils.c:2541:1: start of procedure avformat_close_input()
2539. }
2540. 
2541. void avformat_close_input(AVFormatContext **ps)
      ^
2542. {
2543.     AVFormatContext *s = *ps;

libavformat/utils.c:2543:5: 
2541. void avformat_close_input(AVFormatContext **ps)
2542. {
2543.     AVFormatContext *s = *ps;
          ^
2544.     AVIOContext *pb = s->pb;
2545. 

libavformat/utils.c:2544:5: 
2542. {
2543.     AVFormatContext *s = *ps;
2544.     AVIOContext *pb = s->pb;
          ^
2545. 
2546.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2546:10: Taking true branch
2544.     AVIOContext *pb = s->pb;
2545. 
2546.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2547.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2548.         pb = NULL;

libavformat/utils.c:2546:24: Taking false branch
2544.     AVIOContext *pb = s->pb;
2545. 
2546.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2547.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2548.         pb = NULL;

libavformat/utils.c:2547:10: Taking true branch
2545. 
2546.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2547.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2548.         pb = NULL;
2549. 

libavformat/utils.c:2548:9: 
2546.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2547.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2548.         pb = NULL;
              ^
2549. 
2550.     flush_packet_queue(s);

libavformat/utils.c:2550:5: Skipping flush_packet_queue(): empty list of specs
2548.         pb = NULL;
2549. 
2550.     flush_packet_queue(s);
          ^
2551. 
2552.     if (s->iformat) {

libavformat/utils.c:2552:9: Taking true branch
2550.     flush_packet_queue(s);
2551. 
2552.     if (s->iformat) {
              ^
2553.         if (s->iformat->read_close)
2554.             s->iformat->read_close(s);

libavformat/utils.c:2553:13: Taking true branch
2551. 
2552.     if (s->iformat) {
2553.         if (s->iformat->read_close)
                  ^
2554.             s->iformat->read_close(s);
2555.     }

libavformat/utils.c:2554:13: Skipping __function_pointer__(): unresolved function pointer
2552.     if (s->iformat) {
2553.         if (s->iformat->read_close)
2554.             s->iformat->read_close(s);
                  ^
2555.     }
2556. 

libavformat/utils.c:2557:5: Skipping avformat_free_context(): empty list of specs
2555.     }
2556. 
2557.     avformat_free_context(s);
          ^
2558. 
2559.     *ps = NULL;

libavformat/utils.c:2559:5: 
2557.     avformat_free_context(s);
2558. 
2559.     *ps = NULL;
          ^
2560. 
2561.     avio_close(pb);

libavformat/utils.c:2561:5: 
2559.     *ps = NULL;
2560. 
2561.     avio_close(pb);
          ^
2562. }
2563. 

libavformat/aviobuf.c:782:1: start of procedure avio_close()
  780. }
  781. 
  782. int avio_close(AVIOContext *s)
       ^
  783. {
  784.     URLContext *h;

libavformat/aviobuf.c:786:10: Taking false branch
  784.     URLContext *h;
  785. 
  786.     if (!s)
                ^
  787.         return 0;
  788. 

libavformat/aviobuf.c:789:5: 
  787.         return 0;
  788. 
  789.     avio_flush(s);
           ^
  790.     h = s->opaque;
  791.     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,
