Revision b7effd4e libavformat/ipmovie.c

View differences:

libavformat/ipmovie.c
166 166
        url_fseek(pb, s->decode_map_chunk_offset, SEEK_SET);
167 167
        s->decode_map_chunk_offset = 0;
168 168

  
169
        if (get_buffer(pb, pkt->data, s->decode_map_chunk_size) !=
169
        if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
170 170
            s->decode_map_chunk_size) {
171 171
            av_free_packet(pkt);
172 172
            return CHUNK_EOF;
......
175 175
        url_fseek(pb, s->video_chunk_offset, SEEK_SET);
176 176
        s->video_chunk_offset = 0;
177 177

  
178
        if (get_buffer(pb, pkt->data + s->decode_map_chunk_size,
178
        if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
179 179
            s->video_chunk_size) != s->video_chunk_size) {
180 180
            av_free_packet(pkt);
181 181
            return CHUNK_EOF;
......
227 227
    /* read the next chunk, wherever the file happens to be pointing */
228 228
    if (url_feof(pb))
229 229
        return CHUNK_EOF;
230
    if (get_buffer(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
230
    if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
231 231
        CHUNK_PREAMBLE_SIZE)
232 232
        return CHUNK_BAD;
233 233
    chunk_size = AV_RL16(&chunk_preamble[0]);
......
275 275
            chunk_type = CHUNK_EOF;
276 276
            break;
277 277
        }
278
        if (get_buffer(pb, opcode_preamble, CHUNK_PREAMBLE_SIZE) !=
278
        if (avio_read(pb, opcode_preamble, CHUNK_PREAMBLE_SIZE) !=
279 279
            CHUNK_PREAMBLE_SIZE) {
280 280
            chunk_type = CHUNK_BAD;
281 281
            break;
......
314 314
                chunk_type = CHUNK_BAD;
315 315
                break;
316 316
            }
317
            if (get_buffer(pb, scratch, opcode_size) !=
317
            if (avio_read(pb, scratch, opcode_size) !=
318 318
                opcode_size) {
319 319
                chunk_type = CHUNK_BAD;
320 320
                break;
......
331 331
                chunk_type = CHUNK_BAD;
332 332
                break;
333 333
            }
334
            if (get_buffer(pb, scratch, opcode_size) !=
334
            if (avio_read(pb, scratch, opcode_size) !=
335 335
                opcode_size) {
336 336
                chunk_type = CHUNK_BAD;
337 337
                break;
......
369 369
                chunk_type = CHUNK_BAD;
370 370
                break;
371 371
            }
372
            if (get_buffer(pb, scratch, opcode_size) !=
372
            if (avio_read(pb, scratch, opcode_size) !=
373 373
                opcode_size) {
374 374
                chunk_type = CHUNK_BAD;
375 375
                break;
......
434 434
                chunk_type = CHUNK_BAD;
435 435
                break;
436 436
            }
437
            if (get_buffer(pb, scratch, opcode_size) != opcode_size) {
437
            if (avio_read(pb, scratch, opcode_size) != opcode_size) {
438 438
                chunk_type = CHUNK_BAD;
439 439
                break;
440 440
            }
......
528 528
    int chunk_type;
529 529
    uint8_t signature_buffer[sizeof(signature)];
530 530

  
531
    get_buffer(pb, signature_buffer, sizeof(signature_buffer));
531
    avio_read(pb, signature_buffer, sizeof(signature_buffer));
532 532
    while (memcmp(signature_buffer, signature, sizeof(signature))) {
533 533
        memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
534
        signature_buffer[sizeof(signature_buffer) - 1] = get_byte(pb);
534
        signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
535 535
        if (url_feof(pb))
536 536
            return AVERROR_EOF;
537 537
    }
......
549 549

  
550 550
    /* peek ahead to the next chunk-- if it is an init audio chunk, process
551 551
     * it; if it is the first video chunk, this is a silent file */
552
    if (get_buffer(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
552
    if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
553 553
        CHUNK_PREAMBLE_SIZE)
554 554
        return AVERROR(EIO);
555 555
    chunk_type = AV_RL16(&chunk_preamble[2]);

Also available in: Unified diff