Revision 69c78161 libavformat/wv.c

View differences:

libavformat/wv.c
85 85

  
86 86
    wc->pos = url_ftell(pb);
87 87
    if(!append){
88
    tag = get_le32(pb);
89
    if (tag != MKTAG('w', 'v', 'p', 'k'))
90
        return -1;
91
    size = get_le32(pb);
92
    if(size < 24 || size > WV_BLOCK_LIMIT){
93
        av_log(ctx, AV_LOG_ERROR, "Incorrect block size %i\n", size);
94
        return -1;
95
    }
96
    wc->blksize = size;
97
    ver = get_le16(pb);
98
    if(ver < 0x402 || ver > 0x410){
99
        av_log(ctx, AV_LOG_ERROR, "Unsupported version %03X\n", ver);
100
        return -1;
101
    }
102
    get_byte(pb); // track no
103
    get_byte(pb); // track sub index
104
    wc->samples = get_le32(pb); // total samples in file
105
    wc->soff = get_le32(pb); // offset in samples of current block
106
    get_buffer(pb, wc->extra, WV_EXTRA_SIZE);
88
        tag = get_le32(pb);
89
        if (tag != MKTAG('w', 'v', 'p', 'k'))
90
            return -1;
91
        size = get_le32(pb);
92
        if(size < 24 || size > WV_BLOCK_LIMIT){
93
            av_log(ctx, AV_LOG_ERROR, "Incorrect block size %i\n", size);
94
            return -1;
95
        }
96
        wc->blksize = size;
97
        ver = get_le16(pb);
98
        if(ver < 0x402 || ver > 0x410){
99
            av_log(ctx, AV_LOG_ERROR, "Unsupported version %03X\n", ver);
100
            return -1;
101
        }
102
        get_byte(pb); // track no
103
        get_byte(pb); // track sub index
104
        wc->samples = get_le32(pb); // total samples in file
105
        wc->soff = get_le32(pb); // offset in samples of current block
106
        get_buffer(pb, wc->extra, WV_EXTRA_SIZE);
107 107
    }else{
108 108
        size = wc->blksize;
109 109
    }

Also available in: Unified diff