Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd0359f7 authored by Andreas Huber's avatar Andreas Huber
Browse files

Protect against possible temporary objects going away before we get at their data.

parent 57d2c3ad
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -70,7 +70,8 @@ status_t AACDecoder::start(MetaData *params) {
    uint32_t type;
    const void *data;
    size_t size;
    if (mSource->getFormat()->findData(kKeyESDS, &type, &data, &size)) {
    sp<MetaData> meta = mSource->getFormat();
    if (meta->findData(kKeyESDS, &type, &data, &size)) {
        ESDS esds((const char *)data, size);
        CHECK_EQ(esds.InitCheck(), OK);

+2 −1
Original line number Diff line number Diff line
@@ -90,7 +90,8 @@ status_t AVCDecoder::start(MetaData *) {
    uint32_t type;
    const void *data;
    size_t size;
    if (mSource->getFormat()->findData(kKeyAVCC, &type, &data, &size)) {
    sp<MetaData> meta = mSource->getFormat();
    if (meta->findData(kKeyAVCC, &type, &data, &size)) {
        // Parse the AVCDecoderConfigurationRecord

        const uint8_t *ptr = (const uint8_t *)data;
+3 −2
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@ status_t M4vH263Decoder::start(MetaData *) {
    CHECK(!mStarted);

    const char *mime = NULL;
    CHECK(mSource->getFormat()->findCString(kKeyMIMEType, &mime));
    sp<MetaData> meta = mSource->getFormat();
    CHECK(meta->findCString(kKeyMIMEType, &mime));

    MP4DecodingMode mode;
    if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_MPEG4, mime)) {
@@ -102,7 +103,7 @@ status_t M4vH263Decoder::start(MetaData *) {
    size_t size = 0;
    uint8_t *vol_data[1] = {0};
    int32_t vol_size = 0;
    if (mSource->getFormat()->findData(kKeyESDS, &type, &data, &size)) {
    if (meta->findData(kKeyESDS, &type, &data, &size)) {
        ESDS esds((const uint8_t *)data, size);
        CHECK_EQ(esds.InitCheck(), OK);