static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
    uint64_t size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
    uint8_t *buf;
    if(size > INT_MAX || (uint64_t)atom.size > INT_MAX)
        return -1;
    buf= av_realloc(st->codec->extradata, size);
    if(!buf)
        return -1;
    st->codec->extradata= buf;
    buf+= st->codec->extradata_size;
    st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
    AV_WB32(       buf    , atom.size + 8);
    AV_WL32(       buf + 4, atom.type);
    get_buffer(pb, buf + 8, atom.size);
    return 0;
}
['static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)\n{\n    AVStream *st = c->fc->streams[c->fc->nb_streams-1];\n    uint64_t size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;\n    uint8_t *buf;\n    if(size > INT_MAX || (uint64_t)atom.size > INT_MAX)\n        return -1;\n    buf= av_realloc(st->codec->extradata, size);\n    if(!buf)\n        return -1;\n    st->codec->extradata= buf;\n    buf+= st->codec->extradata_size;\n    st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;\n    AV_WB32(       buf    , atom.size + 8);\n    AV_WL32(       buf + 4, atom.type);\n    get_buffer(pb, buf + 8, atom.size);\n    return 0;\n}', 'void *av_realloc(void *ptr, unsigned int size)\n{\n#ifdef CONFIG_MEMALIGN_HACK\n    int diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef CONFIG_MEMALIGN_HACK\n    if(!ptr) return av_malloc(size);\n    diff= ((char*)ptr)[-1];\n    return (char*)realloc((char*)ptr - diff, size + diff) + diff;\n#else\n    return realloc(ptr, size);\n#endif\n}']