static int read_audio_mux_element(struct LATMContext *latmctx,

                                  GetBitContext *gb)

{

    int err;

    uint8_t use_same_mux = get_bits(gb, 1);

    if (!use_same_mux) {

        if ((err = read_stream_mux_config(latmctx, gb)) < 0)

            return err;

    } else if (!latmctx->aac_ctx.avctx->extradata) {

        av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG,

               "no decoder config found\n");

        return AVERROR(EAGAIN);

    }

    if (latmctx->audio_mux_version_A == 0) {

        int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);

        if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");

            return AVERROR_INVALIDDATA;

        } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,

                   "frame length mismatch %d << %d\n",

                   mux_slot_length_bytes * 8, get_bits_left(gb));

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}

static int read_audio_mux_element(struct LATMContext *latmctx,

                                  GetBitContext *gb)

{

    int err;

    uint8_t use_same_mux = get_bits(gb, 1);

    if (!use_same_mux) {

        if ((err = read_stream_mux_config(latmctx, gb)) < 0)

            return err;

    } else if (!latmctx->aac_ctx.avctx->extradata) {

        av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG,

               "no decoder config found\n");

        return AVERROR(EAGAIN);

    }

    if (latmctx->audio_mux_version_A == 0) {

        int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);

        if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");

            return AVERROR_INVALIDDATA;

        } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {

            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,

                   "frame length mismatch %d << %d\n",

                   mux_slot_length_bytes * 8, get_bits_left(gb));

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}

        if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {
static int FUNC_0(struct LATMContext *VAR_0,

                                  GetBitContext *VAR_1)

{

    int VAR_2;

    uint8_t use_same_mux = get_bits(VAR_1, 1);

    if (!use_same_mux) {

        if ((VAR_2 = read_stream_mux_config(VAR_0, VAR_1)) < 0)

            return VAR_2;

    } else if (!VAR_0->aac_ctx.avctx->extradata) {

        av_log(VAR_0->aac_ctx.avctx, AV_LOG_DEBUG,

               "no decoder config found\n");

        return AVERROR(EAGAIN);

    }

    if (VAR_0->audio_mux_version_A == 0) {

        int VAR_3 = read_payload_length_info(VAR_0, VAR_1);

        if (VAR_3 * 8 > get_bits_left(VAR_1)) {

            av_log(VAR_0->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");

            return AVERROR_INVALIDDATA;

        } else if (VAR_3 * 8 + 256 < get_bits_left(VAR_1)) {

            av_log(VAR_0->aac_ctx.avctx, AV_LOG_ERROR,

                   "frame length mismatch %d << %d\n",

                   VAR_3 * 8, get_bits_left(VAR_1));

            return AVERROR_INVALIDDATA;

        }

    }

    return 0;

}

static int FUNC_0(struct LATMContext *VAR_0,
GetBitContext *VAR_1)
{ int VAR_2; uint8_t use_same_mux = get_bits(VAR_1, 1); if (!use_same_mux) { if ((VAR_2 = read_stream_mux_config(VAR_0, VAR_1)) < 0)
return VAR_2; } else if (!VAR_0->aac_ctx.avctx->extradata) { av_log(VAR_0->aac_ctx.avctx, AV_LOG_DEBUG,
"no decoder config found\n"); return AVERROR(EAGAIN); } if (VAR_0->audio_mux_version_A == 0) { int VAR_3 = read_payload_length_info(VAR_0, VAR_1); if (VAR_3 * 8 > get_bits_left(VAR_1)) { av_log(VAR_0->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n"); return AVERROR_INVALIDDATA; } else if (VAR_3 * 8 + 256 < get_bits_left(VAR_1)) { av_log(VAR_0->aac_ctx.avctx, AV_LOG_ERROR,
"frame length mismatch %d << %d\n",
VAR_3 * 8, get_bits_left(VAR_1)); return AVERROR_INVALIDDATA; } } return 0; }