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

libavformat/utils.c:2487:1: start of procedure avformat_close_input()
2485. }
2486. 
2487. void avformat_close_input(AVFormatContext **ps)
      ^
2488. {
2489.     AVFormatContext *s = *ps;

libavformat/utils.c:2489:5: 
2487. void avformat_close_input(AVFormatContext **ps)
2488. {
2489.     AVFormatContext *s = *ps;
          ^
2490.     AVIOContext *pb    = s->pb;
2491. 

libavformat/utils.c:2490:5: 
2488. {
2489.     AVFormatContext *s = *ps;
2490.     AVIOContext *pb    = s->pb;
          ^
2491. 
2492.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2492:10: Taking true branch
2490.     AVIOContext *pb    = s->pb;
2491. 
2492.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2493.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494.         pb = NULL;

libavformat/utils.c:2492:24: Taking false branch
2490.     AVIOContext *pb    = s->pb;
2491. 
2492.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2493.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494.         pb = NULL;

libavformat/utils.c:2493:10: Taking true branch
2491. 
2492.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2493.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2494.         pb = NULL;
2495. 

libavformat/utils.c:2494:9: 
2492.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2493.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494.         pb = NULL;
              ^
2495. 
2496.     flush_packet_queue(s);

libavformat/utils.c:2496:5: 
2494.         pb = NULL;
2495. 
2496.     flush_packet_queue(s);
          ^
2497. 
2498.     if (s->iformat)

libavformat/utils.c:1026:1: start of procedure flush_packet_queue()
  1024. 
  1025. /* XXX: suppress the packet queue */
  1026. static void flush_packet_queue(AVFormatContext *s)
        ^
  1027. {
  1028.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);

libavformat/utils.c:1028:5: Skipping free_packet_buffer(): empty list of specs
  1026. static void flush_packet_queue(AVFormatContext *s)
  1027. {
  1028.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
            ^
  1029.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
  1030.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);

libavformat/utils.c:1029:5: Skipping free_packet_buffer(): empty list of specs
  1027. {
  1028.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
  1029.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
            ^
  1030.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
  1031. 

libavformat/utils.c:1030:5: Skipping free_packet_buffer(): empty list of specs
  1028.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
  1029.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
  1030.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
            ^
  1031. 
  1032.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;

libavformat/utils.c:1032:5: 
  1030.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
  1031. 
  1032.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
            ^
  1033. }
  1034. 

libavformat/utils.c:1033:1: return from a call to flush_packet_queue
  1031. 
  1032.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
  1033. }
        ^
  1034. 
  1035. /*******************************************************/

libavformat/utils.c:2498:9: Taking true branch
2496.     flush_packet_queue(s);
2497. 
2498.     if (s->iformat)
              ^
2499.         if (s->iformat->read_close)
2500.             s->iformat->read_close(s);

libavformat/utils.c:2499:13: Taking true branch
2497. 
2498.     if (s->iformat)
2499.         if (s->iformat->read_close)
                  ^
2500.             s->iformat->read_close(s);
2501. 

libavformat/utils.c:2500:13: Skipping __function_pointer__(): unresolved function pointer
2498.     if (s->iformat)
2499.         if (s->iformat->read_close)
2500.             s->iformat->read_close(s);
                  ^
2501. 
2502.     avformat_free_context(s);

libavformat/utils.c:2502:5: Skipping avformat_free_context(): empty list of specs
2500.             s->iformat->read_close(s);
2501. 
2502.     avformat_free_context(s);
          ^
2503. 
2504.     *ps = NULL;

libavformat/utils.c:2504:5: 
2502.     avformat_free_context(s);
2503. 
2504.     *ps = NULL;
          ^
2505. 
2506.     avio_close(pb);

libavformat/utils.c:2506:5: 
2504.     *ps = NULL;
2505. 
2506.     avio_close(pb);
          ^
2507. }
2508. 

libavformat/aviobuf.c:800:1: start of procedure avio_close()
  798. }
  799. 
  800. int avio_close(AVIOContext *s)
       ^
  801. {
  802.     URLContext *h;

libavformat/aviobuf.c:804:10: Taking false branch
  802.     URLContext *h;
  803. 
  804.     if (!s)
                ^
  805.         return 0;
  806. 

libavformat/aviobuf.c:807:5: 
  805.         return 0;
  806. 
  807.     avio_flush(s);
           ^
  808.     h = s->opaque;
  809.     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,
