c->buffer_size = new_buffer_size;
static void http_write_packet(void *opaque,                               unsigned char *buf, int size){    HTTPContext *c = opaque;    if (c->buffer_ptr == c->buffer_end || !c->buffer_ptr)        c->buffer_ptr = c->buffer_end = c->buffer;    if (c->buffer_end - c->buffer + size > c->buffer_size) {        UINT8 *new_buffer = av_malloc(c->buffer_size * 2);        if (new_buffer) {            memcpy(new_buffer, c->buffer, c->buffer_end - c->buffer);            c->buffer_end += (new_buffer - c->buffer);            c->buffer_ptr += (new_buffer - c->buffer);            av_free(c->buffer);            c->buffer = new_buffer;        } else {            av_abort();        }    }    memcpy(c->buffer_end, buf, size);    c->buffer_end += size;}