Revision e356fc57 libavformat/mxfdec.c

View differences:

libavformat/mxfdec.c
262 262
        av_aes_init(mxf->aesc, s->key, 128, 1);
263 263
    }
264 264
    // crypto context
265
    url_fskip(pb, klv_decode_ber_length(pb));
265
    avio_seek(pb, klv_decode_ber_length(pb), SEEK_CUR);
266 266
    // plaintext offset
267 267
    klv_decode_ber_length(pb);
268 268
    plaintext_size = avio_rb64(pb);
......
297 297
                     &pkt->data[plaintext_size], size >> 4, ivec, 1);
298 298
    pkt->size = orig_size;
299 299
    pkt->stream_index = index;
300
    url_fskip(pb, end - url_ftell(pb));
300
    avio_seek(pb, end - url_ftell(pb), SEEK_CUR);
301 301
    return 0;
302 302
}
303 303

  
......
339 339
            return 0;
340 340
        } else
341 341
        skip:
342
            url_fskip(s->pb, klv.length);
342
            avio_seek(s->pb, klv.length, SEEK_CUR);
343 343
    }
344 344
    return AVERROR_EOF;
345 345
}
......
397 397
        mxf->packages_refs = av_malloc(mxf->packages_count * sizeof(UID));
398 398
        if (!mxf->packages_refs)
399 399
            return -1;
400
        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */
400
        avio_seek(pb, 4, SEEK_CUR); /* useless size of objects, always 16 according to specs */
401 401
        avio_read(pb, (uint8_t *)mxf->packages_refs, mxf->packages_count * sizeof(UID));
402 402
        break;
403 403
    }
......
416 416
        break;
417 417
    case 0x1101:
418 418
        /* UMID, only get last 16 bytes */
419
        url_fskip(pb, 16);
419
        avio_seek(pb, 16, SEEK_CUR);
420 420
        avio_read(pb, source_clip->source_package_uid, 16);
421 421
        break;
422 422
    case 0x1102:
......
437 437
        package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID));
438 438
        if (!package->tracks_refs)
439 439
            return -1;
440
        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */
440
        avio_seek(pb, 4, SEEK_CUR); /* useless size of objects, always 16 according to specs */
441 441
        avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID));
442 442
        break;
443 443
    }
......
482 482
        sequence->structural_components_refs = av_malloc(sequence->structural_components_count * sizeof(UID));
483 483
        if (!sequence->structural_components_refs)
484 484
            return -1;
485
        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */
485
        avio_seek(pb, 4, SEEK_CUR); /* useless size of objects, always 16 according to specs */
486 486
        avio_read(pb, (uint8_t *)sequence->structural_components_refs, sequence->structural_components_count * sizeof(UID));
487 487
        break;
488 488
    }
......
500 500
        package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID));
501 501
        if (!package->tracks_refs)
502 502
            return -1;
503
        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */
503
        avio_seek(pb, 4, SEEK_CUR); /* useless size of objects, always 16 according to specs */
504 504
        avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID));
505 505
        break;
506 506
    case 0x4401:
507 507
        /* UMID, only get last 16 bytes */
508
        url_fskip(pb, 16);
508
        avio_seek(pb, 16, SEEK_CUR);
509 509
        avio_read(pb, package->package_uid, 16);
510 510
        break;
511 511
    case 0x4701:
......
558 558
        descriptor->sub_descriptors_refs = av_malloc(descriptor->sub_descriptors_count * sizeof(UID));
559 559
        if (!descriptor->sub_descriptors_refs)
560 560
            return -1;
561
        url_fskip(pb, 4); /* useless size of objects, always 16 according to specs */
561
        avio_seek(pb, 4, SEEK_CUR); /* useless size of objects, always 16 according to specs */
562 562
        avio_read(pb, (uint8_t *)descriptor->sub_descriptors_refs, descriptor->sub_descriptors_count * sizeof(UID));
563 563
        break;
564 564
    case 0x3004:
......
943 943
            }
944 944
        }
945 945
        if (!metadata->read)
946
            url_fskip(s->pb, klv.length);
946
            avio_seek(s->pb, klv.length, SEEK_CUR);
947 947
    }
948 948
    return mxf_parse_structural_metadata(mxf);
949 949
}

Also available in: Unified diff