libavcodec/iff.c:124: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 122 could be null and is dereferenced by call to `get_bits1()` at line 124, column 19.

libavcodec/iff.c:117:1: start of procedure decodeplane32()
115.  * @param plane plane number to decode as
116.  */
117. static void decodeplane32(uint32_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane)
     ^
118. {
119.     GetBitContext gb;

libavcodec/iff.c:121:5: 
119.     GetBitContext gb;
120.     int i;
121.     const int b = buf_size * 8;
         ^
122.     init_get_bits(&gb, buf, buf_size * 8);
123.     for(i = 0; i < b; i++) {

libavcodec/iff.c:122:5: 
120.     int i;
121.     const int b = buf_size * 8;
122.     init_get_bits(&gb, buf, buf_size * 8);
         ^
123.     for(i = 0; i < b; i++) {
124.         dst[i] |= get_bits1(&gb) << plane;

libavcodec/get_bits.h:473:1: start of procedure init_get_bits()
  471.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  472.  */
  473. static inline void init_get_bits(GetBitContext *s,
       ^
  474.                    const uint8_t *buffer, int bit_size)
  475. {

libavcodec/get_bits.h:476:5: 
  474.                    const uint8_t *buffer, int bit_size)
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
           ^
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:477:8: Taking true branch
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
              ^
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;

libavcodec/get_bits.h:478:9: 
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
               ^
  479.         buffer = NULL;
  480.     }

libavcodec/get_bits.h:479:9: 
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;
               ^
  480.     }
  481. 

libavcodec/get_bits.h:482:5: 
  480.     }
  481. 
  482.     s->buffer= buffer;
           ^
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;

libavcodec/get_bits.h:483:5: 
  481. 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
           ^
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:484:5: 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;
           ^
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;

libavcodec/get_bits.h:486:5: 
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;
           ^
  487. #elif defined LIBMPEG2_BITSTREAM_READER
  488.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/get_bits.h:496:1: return from a call to init_get_bits
  494.     skip_bits_long(s, 0);
  495. #endif
  496. }
       ^
  497. 
  498. static inline void align_get_bits(GetBitContext *s)

libavcodec/iff.c:123:9: 
121.     const int b = buf_size * 8;
122.     init_get_bits(&gb, buf, buf_size * 8);
123.     for(i = 0; i < b; i++) {
             ^
124.         dst[i] |= get_bits1(&gb) << plane;
125.     }

libavcodec/iff.c:123:16: Loop condition is true. Entering loop body
121.     const int b = buf_size * 8;
122.     init_get_bits(&gb, buf, buf_size * 8);
123.     for(i = 0; i < b; i++) {
                    ^
124.         dst[i] |= get_bits1(&gb) << plane;
125.     }

libavcodec/iff.c:124:9: 
122.     init_get_bits(&gb, buf, buf_size * 8);
123.     for(i = 0; i < b; i++) {
124.         dst[i] |= get_bits1(&gb) << plane;
             ^
125.     }
126. }

libavcodec/get_bits.h:393:1: start of procedure get_bits1()
  391. }
  392. 
  393. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  394. #ifdef ALT_BITSTREAM_READER
  395.     unsigned int index= s->index;

libavcodec/get_bits.h:395:5: 
  393. static inline unsigned int get_bits1(GetBitContext *s){
  394. #ifdef ALT_BITSTREAM_READER
  395.     unsigned int index= s->index;
           ^
  396.     uint8_t result= s->buffer[ index>>3 ];
  397. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:396:5: 
  394. #ifdef ALT_BITSTREAM_READER
  395.     unsigned int index= s->index;
  396.     uint8_t result= s->buffer[ index>>3 ];
           ^
  397. #ifdef ALT_BITSTREAM_READER_LE
  398.     result>>= (index&0x07);

static void decodeplane32(uint32_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane)
{
    GetBitContext gb;
    int i;
    const int b = buf_size * 8;
    init_get_bits(&gb, buf, buf_size * 8);
    for(i = 0; i < b; i++) {
        dst[i] |= get_bits1(&gb) << plane;
    }
}
['static void decodeplane32(uint32_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane)\n{\n    GetBitContext gb;\n    int i;\n    const int b = buf_size * 8;\n    init_get_bits(&gb, buf, buf_size * 8);\n    for(i = 0; i < b; i++) {\n        dst[i] |= get_bits1(&gb) << plane;\n    }\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}', 'static inline unsigned int get_bits1(GetBitContext *s){\n#ifdef ALT_BITSTREAM_READER\n    unsigned int index= s->index;\n    uint8_t result= s->buffer[ index>>3 ];\n#ifdef ALT_BITSTREAM_READER_LE\n    result>>= (index&0x07);\n    result&= 1;\n#else\n    result<<= (index&0x07);\n    result>>= 8 - 1;\n#endif\n    index++;\n    s->index= index;\n    return result;\n#else\n    return get_bits(s, 1);\n#endif\n}']