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

libavformat/utils.c:2509:1: start of procedure avformat_close_input()
2507. }
2508. 
2509. void avformat_close_input(AVFormatContext **ps)
      ^
2510. {
2511.     AVFormatContext *s = *ps;

libavformat/utils.c:2511:5: 
2509. void avformat_close_input(AVFormatContext **ps)
2510. {
2511.     AVFormatContext *s = *ps;
          ^
2512.     AVIOContext *pb    = s->pb;
2513. 

libavformat/utils.c:2512:5: 
2510. {
2511.     AVFormatContext *s = *ps;
2512.     AVIOContext *pb    = s->pb;
          ^
2513. 
2514.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||

libavformat/utils.c:2514:10: Taking true branch
2512.     AVIOContext *pb    = s->pb;
2513. 
2514.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
               ^
2515.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2516.         pb = NULL;

libavformat/utils.c:2514:24: Taking false branch
2512.     AVIOContext *pb    = s->pb;
2513. 
2514.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
                             ^
2515.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2516.         pb = NULL;

libavformat/utils.c:2515:10: Taking true branch
2513. 
2514.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2515.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
               ^
2516.         pb = NULL;
2517. 

libavformat/utils.c:2516:9: 
2514.     if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2515.         (s->flags & AVFMT_FLAG_CUSTOM_IO))
2516.         pb = NULL;
              ^
2517. 
2518.     flush_packet_queue(s);

libavformat/utils.c:2518:5: 
2516.         pb = NULL;
2517. 
2518.     flush_packet_queue(s);
          ^
2519. 
2520.     if (s->iformat)

libavformat/utils.c:1038:1: start of procedure flush_packet_queue()
  1036. 
  1037. /* XXX: suppress the packet queue */
  1038. static void flush_packet_queue(AVFormatContext *s)
        ^
  1039. {
  1040.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);

libavformat/utils.c:1040:5: Skipping free_packet_buffer(): empty list of specs
  1038. static void flush_packet_queue(AVFormatContext *s)
  1039. {
  1040.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
            ^
  1041.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
  1042.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);

libavformat/utils.c:1041:5: Skipping free_packet_buffer(): empty list of specs
  1039. {
  1040.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
  1041.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
            ^
  1042.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
  1043. 

libavformat/utils.c:1042:5: Skipping free_packet_buffer(): empty list of specs
  1040.     free_packet_buffer(&s->internal->parse_queue,       &s->internal->parse_queue_end);
  1041.     free_packet_buffer(&s->internal->packet_buffer,     &s->internal->packet_buffer_end);
  1042.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
            ^
  1043. 
  1044.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;

libavformat/utils.c:1044:5: 
  1042.     free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
  1043. 
  1044.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
            ^
  1045. }
  1046. 

libavformat/utils.c:1045:1: return from a call to flush_packet_queue
  1043. 
  1044.     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
  1045. }
        ^
  1046. 
  1047. /*******************************************************/

libavformat/utils.c:2520:9: Taking true branch
2518.     flush_packet_queue(s);
2519. 
2520.     if (s->iformat)
              ^
2521.         if (s->iformat->read_close)
2522.             s->iformat->read_close(s);

libavformat/utils.c:2521:13: Taking true branch
2519. 
2520.     if (s->iformat)
2521.         if (s->iformat->read_close)
                  ^
2522.             s->iformat->read_close(s);
2523. 

libavformat/utils.c:2522:13: Skipping __function_pointer__(): unresolved function pointer
2520.     if (s->iformat)
2521.         if (s->iformat->read_close)
2522.             s->iformat->read_close(s);
                  ^
2523. 
2524.     avformat_free_context(s);

libavformat/utils.c:2524:5: Skipping avformat_free_context(): empty list of specs
2522.             s->iformat->read_close(s);
2523. 
2524.     avformat_free_context(s);
          ^
2525. 
2526.     *ps = NULL;

libavformat/utils.c:2526:5: 
2524.     avformat_free_context(s);
2525. 
2526.     *ps = NULL;
          ^
2527. 
2528.     avio_close(pb);

libavformat/utils.c:2528:5: 
2526.     *ps = NULL;
2527. 
2528.     avio_close(pb);
          ^
2529. }
2530. 

libavformat/aviobuf.c:816:1: start of procedure avio_close()
  814. }
  815. 
  816. int avio_close(AVIOContext *s)
       ^
  817. {
  818.     URLContext *h;

libavformat/aviobuf.c:820:10: Taking false branch
  818.     URLContext *h;
  819. 
  820.     if (!s)
                ^
  821.         return 0;
  822. 

libavformat/aviobuf.c:823:5: 
  821.         return 0;
  822. 
  823.     avio_flush(s);
           ^
  824.     h = s->opaque;
  825.     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,
