Revision 288f1e68

View differences:

libavcodec/bitstream.h
53 53

  
54 54
static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
55 55
{
56
    if(buffer_size < 0)
57
        buffer= buffer_size= 0;
56
    if(buffer_size < 0) {
57
        buffer_size = 0;
58
        buffer = NULL;
59
    }
58 60

  
59 61
    s->buf = buffer;
60 62
    s->buf_end = s->buf + buffer_size;
......
676 678
                   const uint8_t *buffer, int bit_size)
677 679
{
678 680
    int buffer_size= (bit_size+7)>>3;
679
    if(buffer_size < 0 || bit_size < 0)
680
        buffer= buffer_size= bit_size= 0;
681
    if(buffer_size < 0 || bit_size < 0) {
682
        buffer_size = bit_size = 0;
683
        buffer = NULL;
684
    }
681 685

  
682 686
    s->buffer= buffer;
683 687
    s->size_in_bits= bit_size;

Also available in: Unified diff