libavformat/4xm.c:239: error: Null Dereference
  pointer `fourxm->tracks` last assigned on line 200 could be null and is dereferenced by call to `parse_strk()` at line 239, column 24.

libavformat/4xm.c:189:1: start of procedure fourxm_read_header()
187. }
188. 
189. static int fourxm_read_header(AVFormatContext *s)
     ^
190. {
191.     AVIOContext *pb = s->pb;

libavformat/4xm.c:191:5: 
189. static int fourxm_read_header(AVFormatContext *s)
190. {
191.     AVIOContext *pb = s->pb;
         ^
192.     unsigned int fourcc_tag;
193.     unsigned int size;

libavformat/4xm.c:195:5: 
193.     unsigned int size;
194.     int header_size;
195.     FourxmDemuxContext *fourxm = s->priv_data;
         ^
196.     unsigned char *header;
197.     int i, ret;

libavformat/4xm.c:199:5: 
197.     int i, ret;
198. 
199.     fourxm->track_count = 0;
         ^
200.     fourxm->tracks      = NULL;
201.     fourxm->fps         = 1.0;

libavformat/4xm.c:200:5: 
198. 
199.     fourxm->track_count = 0;
200.     fourxm->tracks      = NULL;
         ^
201.     fourxm->fps         = 1.0;
202. 

libavformat/4xm.c:201:5: 
199.     fourxm->track_count = 0;
200.     fourxm->tracks      = NULL;
201.     fourxm->fps         = 1.0;
         ^
202. 
203.     /* skip the first 3 32-bit numbers */

libavformat/4xm.c:204:5: 
202. 
203.     /* skip the first 3 32-bit numbers */
204.     avio_skip(pb, 12);
         ^
205. 
206.     /* check for LIST-HEAD */

libavformat/avio.h:222:1: start of procedure avio_skip()
  220.  * @return new position or AVERROR.
  221.  */
  222. static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
       ^
  223. {
  224.     return avio_seek(s, offset, SEEK_CUR);

libavformat/avio.h:224:5: Skipping avio_seek(): empty list of specs
  222. static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
  223. {
  224.     return avio_seek(s, offset, SEEK_CUR);
           ^
  225. }
  226. 

libavformat/avio.h:225:1: return from a call to avio_skip
  223. {
  224.     return avio_seek(s, offset, SEEK_CUR);
  225. }
       ^
  226. 
  227. /**

libavformat/4xm.c:207:5: 
205. 
206.     /* check for LIST-HEAD */
207.     GET_LIST_HEADER();
         ^
208.     header_size = size - 4;
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)

libavformat/aviobuf.c:617:1: start of procedure avio_rl32()
  615. }
  616. 
  617. unsigned int avio_rl32(AVIOContext *s)
       ^
  618. {
  619.     unsigned int val;

libavformat/aviobuf.c:620:5: 
  618. {
  619.     unsigned int val;
  620.     val = avio_rl16(s);
           ^
  621.     val |= avio_rl16(s) << 16;
  622.     return val;

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:621:5: 
  619.     unsigned int val;
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
           ^
  622.     return val;
  623. }

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:622:5: 
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
           ^
  623. }
  624. 

libavformat/aviobuf.c:623:1: return from a call to avio_rl32
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
  623. }
       ^
  624. 
  625. uint64_t avio_rl64(AVIOContext *s)

libavformat/4xm.c:207:5: 
205. 
206.     /* check for LIST-HEAD */
207.     GET_LIST_HEADER();
         ^
208.     header_size = size - 4;
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)

libavformat/aviobuf.c:617:1: start of procedure avio_rl32()
  615. }
  616. 
  617. unsigned int avio_rl32(AVIOContext *s)
       ^
  618. {
  619.     unsigned int val;

libavformat/aviobuf.c:620:5: 
  618. {
  619.     unsigned int val;
  620.     val = avio_rl16(s);
           ^
  621.     val |= avio_rl16(s) << 16;
  622.     return val;

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:621:5: 
  619.     unsigned int val;
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
           ^
  622.     return val;
  623. }

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:622:5: 
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
           ^
  623. }
  624. 

libavformat/aviobuf.c:623:1: return from a call to avio_rl32
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
  623. }
       ^
  624. 
  625. uint64_t avio_rl64(AVIOContext *s)

libavformat/4xm.c:207:5: Taking false branch
205. 
206.     /* check for LIST-HEAD */
207.     GET_LIST_HEADER();
         ^
208.     header_size = size - 4;
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)

libavformat/aviobuf.c:617:1: start of procedure avio_rl32()
  615. }
  616. 
  617. unsigned int avio_rl32(AVIOContext *s)
       ^
  618. {
  619.     unsigned int val;

libavformat/aviobuf.c:620:5: 
  618. {
  619.     unsigned int val;
  620.     val = avio_rl16(s);
           ^
  621.     val |= avio_rl16(s) << 16;
  622.     return val;

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:621:5: 
  619.     unsigned int val;
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
           ^
  622.     return val;
  623. }

libavformat/aviobuf.c:601:1: start of procedure avio_rl16()
    599. }
    600. 
    601. unsigned int avio_rl16(AVIOContext *s)
         ^
    602. {
    603.     unsigned int val;

libavformat/aviobuf.c:604:5: 
    602. {
    603.     unsigned int val;
    604.     val = avio_r8(s);
             ^
    605.     val |= avio_r8(s) << 8;
    606.     return val;

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:605:5: 
    603.     unsigned int val;
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
             ^
    606.     return val;
    607. }

libavformat/aviobuf.c:488:1: start of procedure avio_r8()
      486. 
      487. /* XXX: put an inline version */
      488. int avio_r8(AVIOContext *s)
           ^
      489. {
      490.     if (s->buf_ptr >= s->buf_end)

libavformat/aviobuf.c:490:9: Taking false branch
      488. int avio_r8(AVIOContext *s)
      489. {
      490.     if (s->buf_ptr >= s->buf_end)
                   ^
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)

libavformat/aviobuf.c:492:9: Taking true branch
      490.     if (s->buf_ptr >= s->buf_end)
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
                   ^
      493.         return *s->buf_ptr++;
      494.     return 0;

libavformat/aviobuf.c:493:9: 
      491.         fill_buffer(s);
      492.     if (s->buf_ptr < s->buf_end)
      493.         return *s->buf_ptr++;
                   ^
      494.     return 0;
      495. }

libavformat/aviobuf.c:495:1: return from a call to avio_r8
      493.         return *s->buf_ptr++;
      494.     return 0;
      495. }
           ^
      496. 
      497. int avio_read(AVIOContext *s, unsigned char *buf, int size)

libavformat/aviobuf.c:606:5: 
    604.     val = avio_r8(s);
    605.     val |= avio_r8(s) << 8;
    606.     return val;
             ^
    607. }
    608. 

libavformat/aviobuf.c:607:1: return from a call to avio_rl16
    605.     val |= avio_r8(s) << 8;
    606.     return val;
    607. }
         ^
    608. 
    609. unsigned int avio_rl24(AVIOContext *s)

libavformat/aviobuf.c:622:5: 
  620.     val = avio_rl16(s);
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
           ^
  623. }
  624. 

libavformat/aviobuf.c:623:1: return from a call to avio_rl32
  621.     val |= avio_rl16(s) << 16;
  622.     return val;
  623. }
       ^
  624. 
  625. uint64_t avio_rl64(AVIOContext *s)

libavformat/4xm.c:208:5: 
206.     /* check for LIST-HEAD */
207.     GET_LIST_HEADER();
208.     header_size = size - 4;
         ^
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)
210.         return AVERROR_INVALIDDATA;

libavformat/4xm.c:209:9: Taking false branch
207.     GET_LIST_HEADER();
208.     header_size = size - 4;
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)
             ^
210.         return AVERROR_INVALIDDATA;
211. 

libavformat/4xm.c:209:35: Taking false branch
207.     GET_LIST_HEADER();
208.     header_size = size - 4;
209.     if (fourcc_tag != HEAD_TAG || header_size < 0)
                                       ^
210.         return AVERROR_INVALIDDATA;
211. 

libavformat/4xm.c:213:5: 
211. 
212.     /* allocate space for the header and load the whole thing */
213.     header = av_malloc(header_size);
         ^
214.     if (!header)
215.         return AVERROR(ENOMEM);

libavutil/mem.c:62:1: start of procedure av_malloc()
  60.  * linker will do it automatically. */
  61. 
  62. void *av_malloc(size_t size)
      ^
  63. {
  64.     void *ptr = NULL;

libavutil/mem.c:64:5: 
  62. void *av_malloc(size_t size)
  63. {
  64.     void *ptr = NULL;
          ^
  65. #if CONFIG_MEMALIGN_HACK
  66.     long diff;

libavutil/mem.c:70:9: Taking false branch
  68. 
  69.     /* let's disallow possibly ambiguous cases */
  70.     if (size > (INT_MAX - 32) || !size)
              ^
  71.         return NULL;
  72. 

libavutil/mem.c:70:35: Taking false branch
  68. 
  69.     /* let's disallow possibly ambiguous cases */
  70.     if (size > (INT_MAX - 32) || !size)
                                        ^
  71.         return NULL;
  72. 

libavutil/mem.c:81:9: Taking false branch
  79.     ((char *)ptr)[-1] = diff;
  80. #elif HAVE_POSIX_MEMALIGN
  81.     if (posix_memalign(&ptr, 32, size))
              ^
  82.         ptr = NULL;
  83. #elif HAVE_ALIGNED_MALLOC

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavformat/4xm.c:214:10: Taking false branch
212.     /* allocate space for the header and load the whole thing */
213.     header = av_malloc(header_size);
214.     if (!header)
              ^
215.         return AVERROR(ENOMEM);
216.     if (avio_read(pb, header, header_size) != header_size) {

libavformat/4xm.c:216:9: Taking false branch
214.     if (!header)
215.         return AVERROR(ENOMEM);
216.     if (avio_read(pb, header, header_size) != header_size) {
             ^
217.         av_free(header);
218.         return AVERROR(EIO);

libavformat/4xm.c:222:10: 
220. 
221.     /* take the lazy approach and search for any and all vtrk and strk chunks */
222.     for (i = 0; i < header_size - 8; i++) {
              ^
223.         fourcc_tag = AV_RL32(&header[i]);
224.         size       = AV_RL32(&header[i + 4]);

libavformat/4xm.c:222:17: Loop condition is true. Entering loop body
220. 
221.     /* take the lazy approach and search for any and all vtrk and strk chunks */
222.     for (i = 0; i < header_size - 8; i++) {
                     ^
223.         fourcc_tag = AV_RL32(&header[i]);
224.         size       = AV_RL32(&header[i + 4]);

libavformat/4xm.c:223:9: 
221.     /* take the lazy approach and search for any and all vtrk and strk chunks */
222.     for (i = 0; i < header_size - 8; i++) {
223.         fourcc_tag = AV_RL32(&header[i]);
             ^
224.         size       = AV_RL32(&header[i + 4]);
225. 

libavformat/4xm.c:224:9: 
222.     for (i = 0; i < header_size - 8; i++) {
223.         fourcc_tag = AV_RL32(&header[i]);
224.         size       = AV_RL32(&header[i + 4]);
             ^
225. 
226.         if (fourcc_tag == std__TAG) {

libavformat/4xm.c:226:13: Taking false branch
224.         size       = AV_RL32(&header[i + 4]);
225. 
226.         if (fourcc_tag == std__TAG) {
                 ^
227.             if (header_size - i < 16) {
228.                 ret = AVERROR_INVALIDDATA;

libavformat/4xm.c:232:20: Taking false branch
230.             }
231.             fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
232.         } else if (fourcc_tag == vtrk_TAG) {
                        ^
233.             if ((ret = parse_vtrk(s, fourxm, header + i, size,
234.                                   header_size - i)) < 0)

libavformat/4xm.c:238:20: Taking true branch
236. 
237.             i += 8 + size;
238.         } else if (fourcc_tag == strk_TAG) {
                        ^
239.             if ((ret = parse_strk(s, fourxm, header + i, size,
240.                                   header_size - i)) < 0)

libavformat/4xm.c:239:17: 
237.             i += 8 + size;
238.         } else if (fourcc_tag == strk_TAG) {
239.             if ((ret = parse_strk(s, fourxm, header + i, size,
                     ^
240.                                   header_size - i)) < 0)
241.                 goto fail;

libavformat/4xm.c:126:1: start of procedure parse_strk()
  124. 
  125. 
  126. static int parse_strk(AVFormatContext *s,
       ^
  127.                       FourxmDemuxContext *fourxm, uint8_t *buf, int size,
  128.                       int left)

libavformat/4xm.c:133:9: Taking false branch
  131.     int track;
  132.     /* check that there is enough data */
  133.     if (size != strk_SIZE || left < size + 8)
               ^
  134.         return AVERROR_INVALIDDATA;
  135. 

libavformat/4xm.c:133:30: Taking false branch
  131.     int track;
  132.     /* check that there is enough data */
  133.     if (size != strk_SIZE || left < size + 8)
                                    ^
  134.         return AVERROR_INVALIDDATA;
  135. 

libavformat/4xm.c:136:5: 
  134.         return AVERROR_INVALIDDATA;
  135. 
  136.     track = AV_RL32(buf + 8);
           ^
  137.     if (track < 0)
  138.         return AVERROR_INVALIDDATA;

libavformat/4xm.c:137:9: Taking false branch
  135. 
  136.     track = AV_RL32(buf + 8);
  137.     if (track < 0)
               ^
  138.         return AVERROR_INVALIDDATA;
  139.     if (track + 1 > fourxm->track_count) {

libavformat/4xm.c:139:9: Taking false branch
  137.     if (track < 0)
  138.         return AVERROR_INVALIDDATA;
  139.     if (track + 1 > fourxm->track_count) {
               ^
  140.         if (av_reallocp_array(&fourxm->tracks, track + 1, sizeof(AudioTrack)))
  141.             return AVERROR(ENOMEM);

libavformat/4xm.c:146:5: 
  144.         fourxm->track_count = track + 1;
  145.     }
  146.     fourxm->tracks[track].adpcm       = AV_RL32(buf + 12);
           ^
  147.     fourxm->tracks[track].channels    = AV_RL32(buf + 36);
  148.     fourxm->tracks[track].sample_rate = AV_RL32(buf + 40);

static int fourxm_read_header(AVFormatContext *s)
{
    AVIOContext *pb = s->pb;
    unsigned int fourcc_tag;
    unsigned int size;
    int header_size;
    FourxmDemuxContext *fourxm = s->priv_data;
    unsigned char *header;
    int i, ret;
    fourxm->track_count = 0;
    fourxm->tracks      = NULL;
    fourxm->fps         = 1.0;
    avio_skip(pb, 12);
    GET_LIST_HEADER();
    header_size = size - 4;
    if (fourcc_tag != HEAD_TAG || header_size < 0)
        return AVERROR_INVALIDDATA;
    header = av_malloc(header_size);
    if (!header)
        return AVERROR(ENOMEM);
    if (avio_read(pb, header, header_size) != header_size) {
        av_free(header);
        return AVERROR(EIO);
    }
    for (i = 0; i < header_size - 8; i++) {
        fourcc_tag = AV_RL32(&header[i]);
        size       = AV_RL32(&header[i + 4]);
        if (fourcc_tag == std__TAG) {
            if (header_size - i < 16) {
                ret = AVERROR_INVALIDDATA;
                goto fail;
            }
            fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
        } else if (fourcc_tag == vtrk_TAG) {
            if ((ret = parse_vtrk(s, fourxm, header + i, size,
                                  header_size - i)) < 0)
                goto fail;
            i += 8 + size;
        } else if (fourcc_tag == strk_TAG) {
            if ((ret = parse_strk(s, fourxm, header + i, size,
                                  header_size - i)) < 0)
                goto fail;
            i += 8 + size;
        }
    }
    GET_LIST_HEADER();
    if (fourcc_tag != MOVI_TAG) {
        ret = AVERROR_INVALIDDATA;
        goto fail;
    }
    av_free(header);
    fourxm->video_pts = -1;
    return 0;
fail:
    av_freep(&fourxm->tracks);
    av_free(header);
    return ret;
}
['static int fourxm_read_header(AVFormatContext *s)\n{\n    AVIOContext *pb = s->pb;\n    unsigned int fourcc_tag;\n    unsigned int size;\n    int header_size;\n    FourxmDemuxContext *fourxm = s->priv_data;\n    unsigned char *header;\n    int i, ret;\n    fourxm->track_count = 0;\n    fourxm->tracks      = NULL;\n    fourxm->fps         = 1.0;\n    avio_skip(pb, 12);\n    GET_LIST_HEADER();\n    header_size = size - 4;\n    if (fourcc_tag != HEAD_TAG || header_size < 0)\n        return AVERROR_INVALIDDATA;\n    header = av_malloc(header_size);\n    if (!header)\n        return AVERROR(ENOMEM);\n    if (avio_read(pb, header, header_size) != header_size) {\n        av_free(header);\n        return AVERROR(EIO);\n    }\n    for (i = 0; i < header_size - 8; i++) {\n        fourcc_tag = AV_RL32(&header[i]);\n        size       = AV_RL32(&header[i + 4]);\n        if (fourcc_tag == std__TAG) {\n            if (header_size - i < 16) {\n                ret = AVERROR_INVALIDDATA;\n                goto fail;\n            }\n            fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));\n        } else if (fourcc_tag == vtrk_TAG) {\n            if ((ret = parse_vtrk(s, fourxm, header + i, size,\n                                  header_size - i)) < 0)\n                goto fail;\n            i += 8 + size;\n        } else if (fourcc_tag == strk_TAG) {\n            if ((ret = parse_strk(s, fourxm, header + i, size,\n                                  header_size - i)) < 0)\n                goto fail;\n            i += 8 + size;\n        }\n    }\n    GET_LIST_HEADER();\n    if (fourcc_tag != MOVI_TAG) {\n        ret = AVERROR_INVALIDDATA;\n        goto fail;\n    }\n    av_free(header);\n    fourxm->video_pts = -1;\n    return 0;\nfail:\n    av_freep(&fourxm->tracks);\n    av_free(header);\n    return ret;\n}', 'static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)\n{\n    return avio_seek(s, offset, SEEK_CUR);\n}', 'unsigned int avio_rl32(AVIOContext *s)\n{\n    unsigned int val;\n    val = avio_rl16(s);\n    val |= avio_rl16(s) << 16;\n    return val;\n}', 'unsigned int avio_rl16(AVIOContext *s)\n{\n    unsigned int val;\n    val = avio_r8(s);\n    val |= avio_r8(s) << 8;\n    return val;\n}', 'int avio_r8(AVIOContext *s)\n{\n    if (s->buf_ptr >= s->buf_end)\n        fill_buffer(s);\n    if (s->buf_ptr < s->buf_end)\n        return *s->buf_ptr++;\n    return 0;\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if (size > (INT_MAX - 32) || !size)\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size + 32);\n    if (!ptr)\n        return ptr;\n    diff              = ((-(long)ptr - 1) & 31) + 1;\n    ptr               = (char *)ptr + diff;\n    ((char *)ptr)[-1] = diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr, 32, size))\n        ptr = NULL;\n#elif HAVE_ALIGNED_MALLOC\n    ptr = _aligned_malloc(size, 32);\n#elif HAVE_MEMALIGN\n    ptr = memalign(32, size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}', 'static int parse_strk(AVFormatContext *s,\n                      FourxmDemuxContext *fourxm, uint8_t *buf, int size,\n                      int left)\n{\n    AVStream *st;\n    int track;\n    if (size != strk_SIZE || left < size + 8)\n        return AVERROR_INVALIDDATA;\n    track = AV_RL32(buf + 8);\n    if (track < 0)\n        return AVERROR_INVALIDDATA;\n    if (track + 1 > fourxm->track_count) {\n        if (av_reallocp_array(&fourxm->tracks, track + 1, sizeof(AudioTrack)))\n            return AVERROR(ENOMEM);\n        memset(&fourxm->tracks[fourxm->track_count], 0,\n               sizeof(AudioTrack) * (track + 1 - fourxm->track_count));\n        fourxm->track_count = track + 1;\n    }\n    fourxm->tracks[track].adpcm       = AV_RL32(buf + 12);\n    fourxm->tracks[track].channels    = AV_RL32(buf + 36);\n    fourxm->tracks[track].sample_rate = AV_RL32(buf + 40);\n    fourxm->tracks[track].bits        = AV_RL32(buf + 44);\n    fourxm->tracks[track].audio_pts   = 0;\n    if (fourxm->tracks[track].channels    <= 0 ||\n        fourxm->tracks[track].sample_rate <= 0 ||\n        fourxm->tracks[track].bits        <= 0) {\n        av_log(s, AV_LOG_ERROR, "audio header invalid\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    st = avformat_new_stream(s, NULL);\n    if (!st)\n        return AVERROR(ENOMEM);\n    st->id = track;\n    avpriv_set_pts_info(st, 60, 1, fourxm->tracks[track].sample_rate);\n    fourxm->tracks[track].stream_index = st->index;\n    st->codecpar->codec_type            = AVMEDIA_TYPE_AUDIO;\n    st->codecpar->codec_tag             = 0;\n    st->codecpar->channels              = fourxm->tracks[track].channels;\n    st->codecpar->sample_rate           = fourxm->tracks[track].sample_rate;\n    st->codecpar->bits_per_coded_sample = fourxm->tracks[track].bits;\n    st->codecpar->bit_rate              = st->codecpar->channels *\n                                          st->codecpar->sample_rate *\n                                          st->codecpar->bits_per_coded_sample;\n    st->codecpar->block_align           = st->codecpar->channels *\n                                          st->codecpar->bits_per_coded_sample;\n    if (fourxm->tracks[track].adpcm){\n        st->codecpar->codec_id = AV_CODEC_ID_ADPCM_4XM;\n    } else if (st->codecpar->bits_per_coded_sample == 8) {\n        st->codecpar->codec_id = AV_CODEC_ID_PCM_U8;\n    } else\n        st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;\n    return 0;\n}']