if(buffer_size < 0) buffer= buffer_size= 0;
if(buffer_size < 0) { buffer_size = 0; buffer = NULL; }
static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size){    if(buffer_size < 0)        buffer= buffer_size= 0;    s->buf = buffer;    s->buf_end = s->buf + buffer_size;#ifdef ALT_BITSTREAM_WRITER    s->index=0;    ((uint32_t*)(s->buf))[0]=0;//    memset(buffer, 0, buffer_size);#else    s->buf_ptr = s->buf;    s->bit_left=32;    s->bit_buf=0;#endif}