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

libavcodec/iff.c:98:1: start of procedure decodeplane8()
 96.  * @param plane plane number to decode as
 97.  */
 98. static void decodeplane8(uint8_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane)
     ^
 99. {
100.     GetBitContext gb;

libavcodec/iff.c:102:5: 
100.     GetBitContext gb;
101.     int i;
102.     const int b = (buf_size * 8) + bps - 1;
         ^
103.     init_get_bits(&gb, buf, buf_size * 8);
104.     for(i = 0; i < b; i++) {

libavcodec/iff.c:103:5: 
101.     int i;
102.     const int b = (buf_size * 8) + bps - 1;
103.     init_get_bits(&gb, buf, buf_size * 8);
         ^
104.     for(i = 0; i < b; i++) {
105.         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:104:9: 
102.     const int b = (buf_size * 8) + bps - 1;
103.     init_get_bits(&gb, buf, buf_size * 8);
104.     for(i = 0; i < b; i++) {
             ^
105.         dst[i] |= get_bits1(&gb) << plane;
106.     }

libavcodec/iff.c:104:16: Loop condition is true. Entering loop body
102.     const int b = (buf_size * 8) + bps - 1;
103.     init_get_bits(&gb, buf, buf_size * 8);
104.     for(i = 0; i < b; i++) {
                    ^
105.         dst[i] |= get_bits1(&gb) << plane;
106.     }

libavcodec/iff.c:105:9: 
103.     init_get_bits(&gb, buf, buf_size * 8);
104.     for(i = 0; i < b; i++) {
105.         dst[i] |= get_bits1(&gb) << plane;
             ^
106.     }
107. }

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 decodeplane8(uint8_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane)
{
    GetBitContext gb;
    int i;
    const int b = (buf_size * 8) + bps - 1;
    init_get_bits(&gb, buf, buf_size * 8);
    for(i = 0; i < b; i++) {
        dst[i] |= get_bits1(&gb) << plane;
    }
}
['static void decodeplane8(uint8_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) + bps - 1;\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}']