static int mov_read_mfra(MOVContext *c, AVIOContext *f)

{

    int64_t stream_size = avio_size(f);

    int64_t original_pos = avio_tell(f);

    int64_t seek_ret;

    int32_t mfra_size;

    int ret = -1;

    if ((seek_ret = avio_seek(f, stream_size - 4, SEEK_SET)) < 0) {

        ret = seek_ret;

        goto fail;

    }

    mfra_size = avio_rb32(f);

    if (mfra_size < 0 || mfra_size > stream_size) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (unreasonable size)\n");

        goto fail;

    }

    if ((seek_ret = avio_seek(f, -mfra_size, SEEK_CUR)) < 0) {

        ret = seek_ret;

        goto fail;

    }

    if (avio_rb32(f) != mfra_size) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (size mismatch)\n");

        goto fail;

    }

    if (avio_rb32(f) != MKBETAG('m', 'f', 'r', 'a')) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n");

        goto fail;

    }

    ret = 0;

    av_log(c->fc, AV_LOG_VERBOSE, "stream has mfra\n");

    while (!read_tfra(c, f)) {

        /* Empty */

    }

fail:

    seek_ret = avio_seek(f, original_pos, SEEK_SET);

    if (seek_ret < 0) {

        av_log(c->fc, AV_LOG_ERROR,

               "failed to seek back after looking for mfra\n");

        ret = seek_ret;

    }

    return ret;

}

static int mov_read_mfra(MOVContext *c, AVIOContext *f)

{

    int64_t stream_size = avio_size(f);

    int64_t original_pos = avio_tell(f);

    int64_t seek_ret;

    int32_t mfra_size;

    int ret = -1;

    if ((seek_ret = avio_seek(f, stream_size - 4, SEEK_SET)) < 0) {

        ret = seek_ret;

        goto fail;

    }

    mfra_size = avio_rb32(f);

    if (mfra_size < 0 || mfra_size > stream_size) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (unreasonable size)\n");

        goto fail;

    }

    if ((seek_ret = avio_seek(f, -mfra_size, SEEK_CUR)) < 0) {

        ret = seek_ret;

        goto fail;

    }

    if (avio_rb32(f) != mfra_size) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (size mismatch)\n");

        goto fail;

    }

    if (avio_rb32(f) != MKBETAG('m', 'f', 'r', 'a')) {

        av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n");

        goto fail;

    }

    ret = 0;

    av_log(c->fc, AV_LOG_VERBOSE, "stream has mfra\n");

    while (!read_tfra(c, f)) {

        

    }

fail:

    seek_ret = avio_seek(f, original_pos, SEEK_SET);

    if (seek_ret < 0) {

        av_log(c->fc, AV_LOG_ERROR,

               "failed to seek back after looking for mfra\n");

        ret = seek_ret;

    }

    return ret;

}

    ret = 0;     while (!read_tfra(c, f)) {
static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1)

{

    int64_t stream_size = avio_size(VAR_1);

    int64_t original_pos = avio_tell(VAR_1);

    int64_t seek_ret;

    int32_t mfra_size;

    int VAR_2 = -1;

    if ((seek_ret = avio_seek(VAR_1, stream_size - 4, SEEK_SET)) < 0) {

        VAR_2 = seek_ret;

        goto fail;

    }

    mfra_size = avio_rb32(VAR_1);

    if (mfra_size < 0 || mfra_size > stream_size) {

        av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (unreasonable size)\n");

        goto fail;

    }

    if ((seek_ret = avio_seek(VAR_1, -mfra_size, SEEK_CUR)) < 0) {

        VAR_2 = seek_ret;

        goto fail;

    }

    if (avio_rb32(VAR_1) != mfra_size) {

        av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (size mismatch)\n");

        goto fail;

    }

    if (avio_rb32(VAR_1) != MKBETAG('m', 'VAR_1', 'r', 'a')) {

        av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n");

        goto fail;

    }

    VAR_2 = 0;

    av_log(VAR_0->fc, AV_LOG_VERBOSE, "stream has mfra\n");

    while (!read_tfra(VAR_0, VAR_1)) {

        

    }

fail:

    seek_ret = avio_seek(VAR_1, original_pos, SEEK_SET);

    if (seek_ret < 0) {

        av_log(VAR_0->fc, AV_LOG_ERROR,

               "failed to seek back after looking for mfra\n");

        VAR_2 = seek_ret;

    }

    return VAR_2;

}

static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1)
{ int64_t stream_size = avio_size(VAR_1); int64_t original_pos = avio_tell(VAR_1); int64_t seek_ret; int32_t mfra_size; int VAR_2 = -1; if ((seek_ret = avio_seek(VAR_1, stream_size - 4, SEEK_SET)) < 0) { VAR_2 = seek_ret; goto fail; } mfra_size = avio_rb32(VAR_1); if (mfra_size < 0 || mfra_size > stream_size) { av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (unreasonable size)\n"); goto fail; } if ((seek_ret = avio_seek(VAR_1, -mfra_size, SEEK_CUR)) < 0) { VAR_2 = seek_ret; goto fail; } if (avio_rb32(VAR_1) != mfra_size) { av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (size mismatch)\n"); goto fail; } if (avio_rb32(VAR_1) != MKBETAG('m', 'VAR_1', 'r', 'a')) { av_log(VAR_0->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n"); goto fail; } VAR_2 = 0; av_log(VAR_0->fc, AV_LOG_VERBOSE, "stream has mfra\n"); while (!read_tfra(VAR_0, VAR_1)) { } fail:
seek_ret = avio_seek(VAR_1, original_pos, SEEK_SET); if (seek_ret < 0) { av_log(VAR_0->fc, AV_LOG_ERROR,
"failed to seek back after looking for mfra\n"); VAR_2 = seek_ret; } return VAR_2; }