static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
{
    int au_headers_length, au_header_size, i;
    GetBitContext getbitcontext;
    RTPPayloadData *infos;
    infos = s->rtp_payload_data;
    if (infos == NULL)
        return -1;
    au_headers_length = AV_RB16(buf);
    if (au_headers_length > RTP_MAX_PACKET_LENGTH)
      return -1;
    infos->au_headers_length_bytes = (au_headers_length + 7) / 8;
    buf += 2;
    init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);
    au_header_size = infos->sizelength + infos->indexlength;
    if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
        return -1;
    infos->nb_au_headers = au_headers_length / au_header_size;
    infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
    infos->au_headers[0].size = 0;
    infos->au_headers[0].index = 0;
    for (i = 0; i < infos->nb_au_headers; ++i) {
        infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
        infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);
    }
    infos->nb_au_headers = 1;
    return 0;
}
['static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)\n{\n    int au_headers_length, au_header_size, i;\n    GetBitContext getbitcontext;\n    RTPPayloadData *infos;\n    infos = s->rtp_payload_data;\n    if (infos == NULL)\n        return -1;\n    au_headers_length = AV_RB16(buf);\n    if (au_headers_length > RTP_MAX_PACKET_LENGTH)\n      return -1;\n    infos->au_headers_length_bytes = (au_headers_length + 7) / 8;\n    buf += 2;\n    init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);\n    au_header_size = infos->sizelength + infos->indexlength;\n    if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))\n        return -1;\n    infos->nb_au_headers = au_headers_length / au_header_size;\n    infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);\n    infos->au_headers[0].size = 0;\n    infos->au_headers[0].index = 0;\n    for (i = 0; i < infos->nb_au_headers; ++i) {\n        infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);\n        infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);\n    }\n    infos->nb_au_headers = 1;\n    return 0;\n}', 'static av_always_inline av_const uint16_t bswap_16(uint16_t x)\n{\n    x= (x>>8) | (x<<8);\n    return x;\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size= (bit_size+7)>>3;\n    if(buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer= buffer;\n    s->size_in_bits= bit_size;\n    s->buffer_end= buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index=0;\n#elif defined LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 0);\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));\n    s->bit_count = 32 + 8*((intptr_t)buffer&3);\n    skip_bits_long(s, 0);\n#endif\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']