static int alac_set_info(ALACContext *alac)

{

    const unsigned char *ptr = alac->avctx->extradata;



    ptr += 4; /* size */

    ptr += 4; /* alac */

    ptr += 4; /* 0 ? */



    if(AV_RB32(ptr) >= UINT_MAX/4){

        av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");

        return -1;

    }



    /* buffer size / 2 ? */

    alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);

    ptr++;                          /* ??? */

    alac->setinfo_sample_size           = *ptr++;

    alac->setinfo_rice_historymult      = *ptr++;

    alac->setinfo_rice_initialhistory   = *ptr++;

    alac->setinfo_rice_kmodifier        = *ptr++;

    alac->numchannels                   = *ptr++;

    bytestream_get_be16(&ptr);      /* ??? */

    bytestream_get_be32(&ptr);      /* max coded frame size */

    bytestream_get_be32(&ptr);      /* bitrate ? */

    bytestream_get_be32(&ptr);      /* samplerate */



    return 0;

}

static int alac_set_info(ALACContext *alac)

{

    const unsigned char *ptr = alac->avctx->extradata;



    ptr += 4; 

    ptr += 4; 

    ptr += 4; 



    if(AV_RB32(ptr) >= UINT_MAX/4){

        av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");

        return -1;

    }



    

    alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);

    ptr++;                          

    alac->setinfo_sample_size           = *ptr++;

    alac->setinfo_rice_historymult      = *ptr++;

    alac->setinfo_rice_initialhistory   = *ptr++;

    alac->setinfo_rice_kmodifier        = *ptr++;

    alac->numchannels                   = *ptr++;

    bytestream_get_be16(&ptr);      

    bytestream_get_be32(&ptr);      

    bytestream_get_be32(&ptr);      

    bytestream_get_be32(&ptr);      



    return 0;

}

static int alac_set_info(ALACContext *alac)     const unsigned char *ptr = alac->avctx->extradata;     if(AV_RB32(ptr) >= UINT_MAX/4){         av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");         return -1;     alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);     alac->setinfo_sample_size           = *ptr++;     alac->setinfo_rice_historymult      = *ptr++;     alac->setinfo_rice_initialhistory   = *ptr++;     alac->setinfo_rice_kmodifier        = *ptr++;     alac->numchannels                   = *ptr++;     return 0;     return 0;
static int FUNC_0(ALACContext *VAR_0)

{

    const unsigned char *VAR_1 = VAR_0->avctx->extradata;



    VAR_1 += 4; 

    VAR_1 += 4; 

    VAR_1 += 4; 



    if(AV_RB32(VAR_1) >= UINT_MAX/4){

        av_log(VAR_0->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");

        return -1;

    }



    

    VAR_0->setinfo_max_samples_per_frame = bytestream_get_be32(&VAR_1);

    VAR_1++;                          

    VAR_0->setinfo_sample_size           = *VAR_1++;

    VAR_0->setinfo_rice_historymult      = *VAR_1++;

    VAR_0->setinfo_rice_initialhistory   = *VAR_1++;

    VAR_0->setinfo_rice_kmodifier        = *VAR_1++;

    VAR_0->numchannels                   = *VAR_1++;

    bytestream_get_be16(&VAR_1);      

    bytestream_get_be32(&VAR_1);      

    bytestream_get_be32(&VAR_1);      

    bytestream_get_be32(&VAR_1);      



    return 0;

}

static int FUNC_0(ALACContext *VAR_0)
{ const unsigned char *VAR_1 = VAR_0->avctx->extradata; VAR_1 += 4; VAR_1 += 4; VAR_1 += 4; if(AV_RB32(VAR_1) >= UINT_MAX/4){ av_log(VAR_0->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n"); return -1; } VAR_0->setinfo_max_samples_per_frame = bytestream_get_be32(&VAR_1); VAR_1++; VAR_0->setinfo_sample_size           = *VAR_1++; VAR_0->setinfo_rice_historymult      = *VAR_1++; VAR_0->setinfo_rice_initialhistory   = *VAR_1++; VAR_0->setinfo_rice_kmodifier        = *VAR_1++; VAR_0->numchannels                   = *VAR_1++; bytestream_get_be16(&VAR_1); bytestream_get_be32(&VAR_1); bytestream_get_be32(&VAR_1); bytestream_get_be32(&VAR_1); return 0; }