libavformat/nsvdec.c:323: error: Null Dereference
  pointer `p` last assigned on line 319 could be null and is dereferenced at line 323, column 20.

libavformat/nsvdec.c:275:1: start of procedure nsv_parse_NSVf_header()
273. }
274. 
275. static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
     ^
276. {
277.     NSVContext *nsv = s->priv_data;

libavformat/nsvdec.c:277:5: 
275. static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
276. {
277.     NSVContext *nsv = s->priv_data;
         ^
278.     ByteIOContext *pb = s->pb;
279.     unsigned int file_size, size;

libavformat/nsvdec.c:278:5: 
276. {
277.     NSVContext *nsv = s->priv_data;
278.     ByteIOContext *pb = s->pb;
         ^
279.     unsigned int file_size, size;
280.     int64_t duration;

libavformat/nsvdec.c:287:5: 
285.     PRINT(("%s()\n", __FUNCTION__));
286. 
287.     nsv->state = NSV_UNSYNC; /* in case we fail */
         ^
288. 
289.     size = get_le32(pb);

libavformat/nsvdec.c:289:5: 
287.     nsv->state = NSV_UNSYNC; /* in case we fail */
288. 
289.     size = get_le32(pb);
         ^
290.     if (size < 28)
291.         return -1;

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:290:9: Taking false branch
288. 
289.     size = get_le32(pb);
290.     if (size < 28)
             ^
291.         return -1;
292.     nsv->NSVf_end = size;

libavformat/nsvdec.c:292:5: 
290.     if (size < 28)
291.         return -1;
292.     nsv->NSVf_end = size;
         ^
293. 
294.     //s->file_size = (uint32_t)get_le32(pb);

libavformat/nsvdec.c:295:5: 
293. 
294.     //s->file_size = (uint32_t)get_le32(pb);
295.     file_size = (uint32_t)get_le32(pb);
         ^
296.     PRINT(("NSV NSVf chunk_size %u\n", size));
297.     PRINT(("NSV NSVf file_size %u\n", file_size));

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:299:5: 
297.     PRINT(("NSV NSVf file_size %u\n", file_size));
298. 
299.     nsv->duration = duration = get_le32(pb); /* in ms */
         ^
300.     PRINT(("NSV NSVf duration %"PRId64" ms\n", duration));
301.     // XXX: store it in AVStreams

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:303:5: 
301.     // XXX: store it in AVStreams
302. 
303.     strings_size = get_le32(pb);
         ^
304.     table_entries = get_le32(pb);
305.     table_entries_used = get_le32(pb);

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:304:5: 
302. 
303.     strings_size = get_le32(pb);
304.     table_entries = get_le32(pb);
         ^
305.     table_entries_used = get_le32(pb);
306.     PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:305:5: 
303.     strings_size = get_le32(pb);
304.     table_entries = get_le32(pb);
305.     table_entries_used = get_le32(pb);
         ^
306.     PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
307.             strings_size, table_entries, table_entries_used));

libavformat/aviobuf.c:443:1: start of procedure get_le32()
  441. }
  442. 
  443. unsigned int get_le32(ByteIOContext *s)
       ^
  444. {
  445.     unsigned int val;

libavformat/aviobuf.c:446:5: 
  444. {
  445.     unsigned int val;
  446.     val = get_le16(s);
           ^
  447.     val |= get_le16(s) << 16;
  448.     return val;

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:447:5: 
  445.     unsigned int val;
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
           ^
  448.     return val;
  449. }

libavformat/aviobuf.c:427:1: start of procedure get_le16()
    425. }
    426. 
    427. unsigned int get_le16(ByteIOContext *s)
         ^
    428. {
    429.     unsigned int val;

libavformat/aviobuf.c:430:5: 
    428. {
    429.     unsigned int val;
    430.     val = get_byte(s);
             ^
    431.     val |= get_byte(s) << 8;
    432.     return val;

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:431:5: 
    429.     unsigned int val;
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
             ^
    432.     return val;
    433. }

libavformat/aviobuf.c:339:1: start of procedure get_byte()
      337. 
      338. /* XXX: put an inline version */
      339. int get_byte(ByteIOContext *s)
           ^
      340. {
      341.     if (s->buf_ptr < s->buf_end) {

libavformat/aviobuf.c:341:9: Taking true branch
      339. int get_byte(ByteIOContext *s)
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
                   ^
      342.         return *s->buf_ptr++;
      343.     } else {

libavformat/aviobuf.c:342:9: 
      340. {
      341.     if (s->buf_ptr < s->buf_end) {
      342.         return *s->buf_ptr++;
                   ^
      343.     } else {
      344.         fill_buffer(s);

libavformat/aviobuf.c:350:1: return from a call to get_byte
      348.             return 0;
      349.     }
      350. }
           ^
      351. 
      352. int url_fgetc(ByteIOContext *s)

libavformat/aviobuf.c:432:5: 
    430.     val = get_byte(s);
    431.     val |= get_byte(s) << 8;
    432.     return val;
             ^
    433. }
    434. 

libavformat/aviobuf.c:433:1: return from a call to get_le16
    431.     val |= get_byte(s) << 8;
    432.     return val;
    433. }
         ^
    434. 
    435. unsigned int get_le24(ByteIOContext *s)

libavformat/aviobuf.c:448:5: 
  446.     val = get_le16(s);
  447.     val |= get_le16(s) << 16;
  448.     return val;
           ^
  449. }
  450. 

libavformat/aviobuf.c:449:1: return from a call to get_le32
  447.     val |= get_le16(s) << 16;
  448.     return val;
  449. }
       ^
  450. 
  451. uint64_t get_le64(ByteIOContext *s)

libavformat/nsvdec.c:308:9: 
306.     PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
307.             strings_size, table_entries, table_entries_used));
308.     if (url_feof(pb))
             ^
309.         return -1;
310. 

libavformat/aviobuf.c:208:1: start of procedure url_feof()
  206. }
  207. 
  208. int url_feof(ByteIOContext *s)
       ^
  209. {
  210.     if(!s)

libavformat/aviobuf.c:210:9: Taking false branch
  208. int url_feof(ByteIOContext *s)
  209. {
  210.     if(!s)
               ^
  211.         return 0;
  212.     return s->eof_reached;

libavformat/aviobuf.c:212:5: 
  210.     if(!s)
  211.         return 0;
  212.     return s->eof_reached;
           ^
  213. }
  214. 

libavformat/aviobuf.c:213:1: return from a call to url_feof
  211.         return 0;
  212.     return s->eof_reached;
  213. }
       ^
  214. 
  215. int url_ferror(ByteIOContext *s)

libavformat/nsvdec.c:308:9: Taking false branch
306.     PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
307.             strings_size, table_entries, table_entries_used));
308.     if (url_feof(pb))
             ^
309.         return -1;
310. 

libavformat/nsvdec.c:313:9: Taking true branch
311.     PRINT(("NSV got header; filepos %"PRId64"\n", url_ftell(pb)));
312. 
313.     if (strings_size > 0) {
             ^
314.         char *strings; /* last byte will be '\0' to play safe with str*() */
315.         char *p, *endp;

libavformat/nsvdec.c:319:9: 
317.         char quote;
318. 
319.         p = strings = av_mallocz(strings_size + 1);
             ^
320.         endp = strings + strings_size;
321.         get_buffer(pb, strings, strings_size);

libavutil/mem.c:132:1: start of procedure av_mallocz()
  130. }
  131. 
  132. void *av_mallocz(unsigned int size)
       ^
  133. {
  134.     void *ptr = av_malloc(size);

libavutil/mem.c:134:5: 
  132. void *av_mallocz(unsigned int size)
  133. {
  134.     void *ptr = av_malloc(size);
           ^
  135.     if (ptr)
  136.         memset(ptr, 0, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking true branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:51:9: 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
    51.         return NULL;
                ^
    52. 
    53. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:135:9: Taking false branch
  133. {
  134.     void *ptr = av_malloc(size);
  135.     if (ptr)
               ^
  136.         memset(ptr, 0, size);
  137.     return ptr;

libavutil/mem.c:137:5: 
  135.     if (ptr)
  136.         memset(ptr, 0, size);
  137.     return ptr;
           ^
  138. }
  139. 

libavutil/mem.c:138:1: return from a call to av_mallocz
  136.         memset(ptr, 0, size);
  137.     return ptr;
  138. }
       ^
  139. 
  140. char *av_strdup(const char *s)

libavformat/nsvdec.c:320:9: 
318. 
319.         p = strings = av_mallocz(strings_size + 1);
320.         endp = strings + strings_size;
             ^
321.         get_buffer(pb, strings, strings_size);
322.         while (p < endp) {

libavformat/nsvdec.c:321:9: Skipping get_buffer(): empty list of specs
319.         p = strings = av_mallocz(strings_size + 1);
320.         endp = strings + strings_size;
321.         get_buffer(pb, strings, strings_size);
             ^
322.         while (p < endp) {
323.             while (*p == ' ')

libavformat/nsvdec.c:322:16: Loop condition is true. Entering loop body
320.         endp = strings + strings_size;
321.         get_buffer(pb, strings, strings_size);
322.         while (p < endp) {
                    ^
323.             while (*p == ' ')
324.                 p++; /* strip out spaces */

libavformat/nsvdec.c:323:20: 
321.         get_buffer(pb, strings, strings_size);
322.         while (p < endp) {
323.             while (*p == ' ')
                        ^
324.                 p++; /* strip out spaces */
325.             if (p >= endp-2)

static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
{
    NSVContext *nsv = s->priv_data;
    ByteIOContext *pb = s->pb;
    unsigned int file_size, size;
    int64_t duration;
    int strings_size;
    int table_entries;
    int table_entries_used;
    PRINT(("%s()\n", __FUNCTION__));
    nsv->state = NSV_UNSYNC;
    size = get_le32(pb);
    if (size < 28)
        return -1;
    nsv->NSVf_end = size;
    file_size = (uint32_t)get_le32(pb);
    PRINT(("NSV NSVf chunk_size %u\n", size));
    PRINT(("NSV NSVf file_size %u\n", file_size));
    nsv->duration = duration = get_le32(pb);
    PRINT(("NSV NSVf duration %"PRId64" ms\n", duration));
    strings_size = get_le32(pb);
    table_entries = get_le32(pb);
    table_entries_used = get_le32(pb);
    PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
            strings_size, table_entries, table_entries_used));
    if (url_feof(pb))
        return -1;
    PRINT(("NSV got header; filepos %"PRId64"\n", url_ftell(pb)));
    if (strings_size > 0) {
        char *strings;
        char *p, *endp;
        char *token, *value;
        char quote;
        p = strings = av_mallocz(strings_size + 1);
        endp = strings + strings_size;
        get_buffer(pb, strings, strings_size);
        while (p < endp) {
            while (*p == ' ')
                p++;
            if (p >= endp-2)
                break;
            token = p;
            p = strchr(p, '=');
            if (!p || p >= endp-2)
                break;
            *p++ = '\0';
            quote = *p++;
            value = p;
            p = strchr(p, quote);
            if (!p || p >= endp)
                break;
            *p++ = '\0';
            PRINT(("NSV NSVf INFO: %s='%s'\n", token, value));
            if (!strcmp(token, "ASPECT")) {
            } else if (!strcmp(token, "CREATOR") || !strcmp(token, "Author")) {
                strncpy(s->author, value, 512-1);
            } else if (!strcmp(token, "Copyright")) {
                strncpy(s->copyright, value, 512-1);
            } else if (!strcmp(token, "TITLE") || !strcmp(token, "Title")) {
                strncpy(s->title, value, 512-1);
            }
        }
        av_free(strings);
    }
    if (url_feof(pb))
        return -1;
    PRINT(("NSV got infos; filepos %"PRId64"\n", url_ftell(pb)));
    if (table_entries_used > 0) {
        nsv->index_entries = table_entries_used;
        if((unsigned)table_entries >= UINT_MAX / sizeof(uint32_t))
            return -1;
        nsv->nsvf_index_data = av_malloc(table_entries * sizeof(uint32_t));
#warning "FIXME: Byteswap buffer as needed"
        get_buffer(pb, (unsigned char *)nsv->nsvf_index_data, table_entries * sizeof(uint32_t));
    }
    PRINT(("NSV got index; filepos %"PRId64"\n", url_ftell(pb)));
#ifdef DEBUG_DUMP_INDEX
#define V(v) ((v<0x20 || v > 127)?'.':v)
    PRINT(("NSV %d INDEX ENTRIES:\n", table_entries));
    PRINT(("NSV [dataoffset][fileoffset]\n", table_entries));
    for (i = 0; i < table_entries; i++) {
        unsigned char b[8];
        url_fseek(pb, size + nsv->nsvf_index_data[i], SEEK_SET);
        get_buffer(pb, b, 8);
        PRINT(("NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x"
           "%c%c%c%c%c%c%c%c\n",
           nsv->nsvf_index_data[i], size + nsv->nsvf_index_data[i],
           b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
           V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) ));
    }
#undef V
#endif
    url_fseek(pb, nsv->base_offset + size, SEEK_SET);
    if (url_feof(pb))
        return -1;
    nsv->state = NSV_HAS_READ_NSVF;
    return 0;
}
['static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)\n{\n    NSVContext *nsv = s->priv_data;\n    ByteIOContext *pb = s->pb;\n    unsigned int file_size, size;\n    int64_t duration;\n    int strings_size;\n    int table_entries;\n    int table_entries_used;\n    PRINT(("%s()\\n", __FUNCTION__));\n    nsv->state = NSV_UNSYNC;\n    size = get_le32(pb);\n    if (size < 28)\n        return -1;\n    nsv->NSVf_end = size;\n    file_size = (uint32_t)get_le32(pb);\n    PRINT(("NSV NSVf chunk_size %u\\n", size));\n    PRINT(("NSV NSVf file_size %u\\n", file_size));\n    nsv->duration = duration = get_le32(pb);\n    PRINT(("NSV NSVf duration %"PRId64" ms\\n", duration));\n    strings_size = get_le32(pb);\n    table_entries = get_le32(pb);\n    table_entries_used = get_le32(pb);\n    PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\\n",\n            strings_size, table_entries, table_entries_used));\n    if (url_feof(pb))\n        return -1;\n    PRINT(("NSV got header; filepos %"PRId64"\\n", url_ftell(pb)));\n    if (strings_size > 0) {\n        char *strings;\n        char *p, *endp;\n        char *token, *value;\n        char quote;\n        p = strings = av_mallocz(strings_size + 1);\n        endp = strings + strings_size;\n        get_buffer(pb, strings, strings_size);\n        while (p < endp) {\n            while (*p == \' \')\n                p++;\n            if (p >= endp-2)\n                break;\n            token = p;\n            p = strchr(p, \'=\');\n            if (!p || p >= endp-2)\n                break;\n            *p++ = \'\\0\';\n            quote = *p++;\n            value = p;\n            p = strchr(p, quote);\n            if (!p || p >= endp)\n                break;\n            *p++ = \'\\0\';\n            PRINT(("NSV NSVf INFO: %s=\'%s\'\\n", token, value));\n            if (!strcmp(token, "ASPECT")) {\n            } else if (!strcmp(token, "CREATOR") || !strcmp(token, "Author")) {\n                strncpy(s->author, value, 512-1);\n            } else if (!strcmp(token, "Copyright")) {\n                strncpy(s->copyright, value, 512-1);\n            } else if (!strcmp(token, "TITLE") || !strcmp(token, "Title")) {\n                strncpy(s->title, value, 512-1);\n            }\n        }\n        av_free(strings);\n    }\n    if (url_feof(pb))\n        return -1;\n    PRINT(("NSV got infos; filepos %"PRId64"\\n", url_ftell(pb)));\n    if (table_entries_used > 0) {\n        nsv->index_entries = table_entries_used;\n        if((unsigned)table_entries >= UINT_MAX / sizeof(uint32_t))\n            return -1;\n        nsv->nsvf_index_data = av_malloc(table_entries * sizeof(uint32_t));\n#warning "FIXME: Byteswap buffer as needed"\n        get_buffer(pb, (unsigned char *)nsv->nsvf_index_data, table_entries * sizeof(uint32_t));\n    }\n    PRINT(("NSV got index; filepos %"PRId64"\\n", url_ftell(pb)));\n#ifdef DEBUG_DUMP_INDEX\n#define V(v) ((v<0x20 || v > 127)?\'.\':v)\n    PRINT(("NSV %d INDEX ENTRIES:\\n", table_entries));\n    PRINT(("NSV [dataoffset][fileoffset]\\n", table_entries));\n    for (i = 0; i < table_entries; i++) {\n        unsigned char b[8];\n        url_fseek(pb, size + nsv->nsvf_index_data[i], SEEK_SET);\n        get_buffer(pb, b, 8);\n        PRINT(("NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x"\n           "%c%c%c%c%c%c%c%c\\n",\n           nsv->nsvf_index_data[i], size + nsv->nsvf_index_data[i],\n           b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\n           V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) ));\n    }\n#undef V\n#endif\n    url_fseek(pb, nsv->base_offset + size, SEEK_SET);\n    if (url_feof(pb))\n        return -1;\n    nsv->state = NSV_HAS_READ_NSVF;\n    return 0;\n}', 'unsigned int get_le32(ByteIOContext *s)\n{\n    unsigned int val;\n    val = get_le16(s);\n    val |= get_le16(s) << 16;\n    return val;\n}', 'unsigned int get_le16(ByteIOContext *s)\n{\n    unsigned int val;\n    val = get_byte(s);\n    val |= get_byte(s) << 8;\n    return val;\n}', 'int get_byte(ByteIOContext *s)\n{\n    if (s->buf_ptr < s->buf_end) {\n        return *s->buf_ptr++;\n    } else {\n        fill_buffer(s);\n        if (s->buf_ptr < s->buf_end)\n            return *s->buf_ptr++;\n        else\n            return 0;\n    }\n}', 'int url_feof(ByteIOContext *s)\n{\n    if(!s)\n        return 0;\n    return s->eof_reached;\n}', 'void *av_mallocz(unsigned int size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr;\n#ifdef CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif defined (HAVE_MEMALIGN)\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']