Revision b7effd4e libavformat/wav.c

View differences:

libavformat/wav.c
143 143

  
144 144
static int64_t next_tag(AVIOContext *pb, unsigned int *tag)
145 145
{
146
    *tag = get_le32(pb);
147
    return get_le32(pb);
146
    *tag = avio_rl32(pb);
147
    return avio_rl32(pb);
148 148
}
149 149

  
150 150
/* return the size of the found tag */
......
197 197
    WAVContext *wav = s->priv_data;
198 198

  
199 199
    /* check RIFF header */
200
    tag = get_le32(pb);
200
    tag = avio_rl32(pb);
201 201

  
202 202
    rf64 = tag == MKTAG('R', 'F', '6', '4');
203 203
    if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F'))
204 204
        return -1;
205
    get_le32(pb); /* file size */
206
    tag = get_le32(pb);
205
    avio_rl32(pb); /* file size */
206
    tag = avio_rl32(pb);
207 207
    if (tag != MKTAG('W', 'A', 'V', 'E'))
208 208
        return -1;
209 209

  
210 210
    if (rf64) {
211
        if (get_le32(pb) != MKTAG('d', 's', '6', '4'))
211
        if (avio_rl32(pb) != MKTAG('d', 's', '6', '4'))
212 212
            return -1;
213
        size = get_le32(pb);
213
        size = avio_rl32(pb);
214 214
        if (size < 16)
215 215
            return -1;
216
        get_le64(pb); /* RIFF size */
217
        data_size = get_le64(pb);
218
        sample_count = get_le64(pb);
216
        avio_rl64(pb); /* RIFF size */
217
        data_size = avio_rl64(pb);
218
        sample_count = avio_rl64(pb);
219 219
        url_fskip(pb, size - 16); /* skip rest of ds64 chunk */
220 220
    }
221 221

  
......
239 239
        if (tag == MKTAG('d', 'a', 't', 'a')){
240 240
            break;
241 241
        }else if (tag == MKTAG('f','a','c','t') && !sample_count){
242
            sample_count = get_le32(pb);
242
            sample_count = avio_rl32(pb);
243 243
            size -= 4;
244 244
        }
245 245
        url_fseek(pb, size, SEEK_CUR);
......
269 269
    int64_t size;
270 270

  
271 271
    while (!url_feof(pb)) {
272
        get_buffer(pb, guid, 16);
273
        size = get_le64(pb);
272
        avio_read(pb, guid, 16);
273
        size = avio_rl64(pb);
274 274
        if (size <= 24)
275 275
            return -1;
276 276
        if (!memcmp(guid, guid1, 16))
......
384 384
    AVStream *st;
385 385
    uint8_t guid[16];
386 386

  
387
    get_buffer(pb, guid, 16);
387
    avio_read(pb, guid, 16);
388 388
    if (memcmp(guid, guid_riff, 16))
389 389
        return -1;
390 390

  
391
    if (get_le64(pb) < 16 + 8 + 16 + 8 + 16 + 8) /* riff + wave + fmt + sizes */
391
    if (avio_rl64(pb) < 16 + 8 + 16 + 8 + 16 + 8) /* riff + wave + fmt + sizes */
392 392
        return -1;
393 393

  
394
    get_buffer(pb, guid, 16);
394
    avio_read(pb, guid, 16);
395 395
    if (memcmp(guid, guid_wave, 16)) {
396 396
        av_log(s, AV_LOG_ERROR, "could not find wave guid\n");
397 397
        return -1;

Also available in: Unified diff