libavcodec/shorten.c:194: error: Null Dereference
  pointer `&hb->buffer` last assigned on line 193 could be null and is dereferenced by call to `get_le32()` at line 194, column 9.

libavcodec/shorten.c:186:1: start of procedure decode_wave_header()
184. }
185. 
186. static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header_size)
     ^
187. {
188.     GetBitContext hb;

libavcodec/shorten.c:193:5: 
191.     short wave_format;
192. 
193.     init_get_bits(&hb, header, header_size*8);
         ^
194.     if (get_le32(&hb) != MKTAG('R','I','F','F')) {
195.         av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");

libavcodec/bitstream.h:745:1: start of procedure init_get_bits()
  743.  * @param bit_size the size of the buffer in bits
  744.  */
  745. static inline void init_get_bits(GetBitContext *s,
       ^
  746.                    const uint8_t *buffer, int bit_size)
  747. {

libavcodec/bitstream.h:748:5: 
  746.                    const uint8_t *buffer, int bit_size)
  747. {
  748.     int buffer_size= (bit_size+7)>>3;
           ^
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:749:8: Taking true branch
  747. {
  748.     int buffer_size= (bit_size+7)>>3;
  749.     if(buffer_size < 0 || bit_size < 0) {
              ^
  750.         buffer_size = bit_size = 0;
  751.         buffer = NULL;

libavcodec/bitstream.h:750:9: 
  748.     int buffer_size= (bit_size+7)>>3;
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;
               ^
  751.         buffer = NULL;
  752.     }

libavcodec/bitstream.h:751:9: 
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;
  751.         buffer = NULL;
               ^
  752.     }
  753. 

libavcodec/bitstream.h:754:5: 
  752.     }
  753. 
  754.     s->buffer= buffer;
           ^
  755.     s->size_in_bits= bit_size;
  756.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:755:5: 
  753. 
  754.     s->buffer= buffer;
  755.     s->size_in_bits= bit_size;
           ^
  756.     s->buffer_end= buffer + buffer_size;
  757. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:756:5: 
  754.     s->buffer= buffer;
  755.     s->size_in_bits= bit_size;
  756.     s->buffer_end= buffer + buffer_size;
           ^
  757. #ifdef ALT_BITSTREAM_READER
  758.     s->index=0;

libavcodec/bitstream.h:758:5: 
  756.     s->buffer_end= buffer + buffer_size;
  757. #ifdef ALT_BITSTREAM_READER
  758.     s->index=0;
           ^
  759. #elif defined LIBMPEG2_BITSTREAM_READER
  760.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:768:1: return from a call to init_get_bits
  766.     skip_bits_long(s, 0);
  767. #endif
  768. }
       ^
  769. 
  770. static inline void align_get_bits(GetBitContext *s)

libavcodec/shorten.c:194:9: 
192. 
193.     init_get_bits(&hb, header, header_size*8);
194.     if (get_le32(&hb) != MKTAG('R','I','F','F')) {
             ^
195.         av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
196.         return -1;

libavcodec/shorten.c:176:1: start of procedure get_le32()
  174. }
  175. 
  176. static inline int get_le32(GetBitContext *gb)
       ^
  177. {
  178.     return bswap_32(get_bits_long(gb, 32));

libavcodec/shorten.c:178:5: 
  176. static inline int get_le32(GetBitContext *gb)
  177. {
  178.     return bswap_32(get_bits_long(gb, 32));
           ^
  179. }
  180. 

libavcodec/bitstream.h:704:1: start of procedure get_bits_long()
    702.  * reads 0-32 bits.
    703.  */
    704. static inline unsigned int get_bits_long(GetBitContext *s, int n){
         ^
    705.     if(n<=17) return get_bits(s, n);
    706.     else{

libavcodec/bitstream.h:705:8: Taking false branch
    703.  */
    704. static inline unsigned int get_bits_long(GetBitContext *s, int n){
    705.     if(n<=17) return get_bits(s, n);
                ^
    706.     else{
    707. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:711:9: 
    709.         return ret | (get_bits(s, n-16) << 16);
    710. #else
    711.         int ret= get_bits(s, 16) << (n-16);
                 ^
    712.         return ret | get_bits(s, n-16);
    713. #endif

libavcodec/bitstream.h:642:1: start of procedure get_bits()
      640.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
      641.  */
      642. static inline unsigned int get_bits(GetBitContext *s, int n){
           ^
      643.     register int tmp;
      644.     OPEN_READER(re, s)

libavcodec/bitstream.h:644:5: 
      642. static inline unsigned int get_bits(GetBitContext *s, int n){
      643.     register int tmp;
      644.     OPEN_READER(re, s)
               ^
      645.     UPDATE_CACHE(re, s)
      646.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:645:5: 
      643.     register int tmp;
      644.     OPEN_READER(re, s)
      645.     UPDATE_CACHE(re, s)
               ^
      646.     tmp= SHOW_UBITS(re, s, n);
      647.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:646:5: 
      644.     OPEN_READER(re, s)
      645.     UPDATE_CACHE(re, s)
      646.     tmp= SHOW_UBITS(re, s, n);
               ^
      647.     LAST_SKIP_BITS(re, s, n)
      648.     CLOSE_READER(re, s)

libavcodec/bitstream.h:647:5: 
      645.     UPDATE_CACHE(re, s)
      646.     tmp= SHOW_UBITS(re, s, n);
      647.     LAST_SKIP_BITS(re, s, n)
               ^
      648.     CLOSE_READER(re, s)
      649.     return tmp;

libavcodec/bitstream.h:648:5: 
      646.     tmp= SHOW_UBITS(re, s, n);
      647.     LAST_SKIP_BITS(re, s, n)
      648.     CLOSE_READER(re, s)
               ^
      649.     return tmp;
      650. }

libavcodec/bitstream.h:649:5: 
      647.     LAST_SKIP_BITS(re, s, n)
      648.     CLOSE_READER(re, s)
      649.     return tmp;
               ^
      650. }
      651. 

libavcodec/bitstream.h:650:1: return from a call to get_bits
      648.     CLOSE_READER(re, s)
      649.     return tmp;
      650. }
           ^
      651. 
      652. /**

libavcodec/bitstream.h:712:9: 
    710. #else
    711.         int ret= get_bits(s, 16) << (n-16);
    712.         return ret | get_bits(s, n-16);
                 ^
    713. #endif
    714.     }

libavcodec/bitstream.h:642:1: start of procedure get_bits()
      640.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
      641.  */
      642. static inline unsigned int get_bits(GetBitContext *s, int n){
           ^
      643.     register int tmp;
      644.     OPEN_READER(re, s)

libavcodec/bitstream.h:644:5: 
      642. static inline unsigned int get_bits(GetBitContext *s, int n){
      643.     register int tmp;
      644.     OPEN_READER(re, s)
               ^
      645.     UPDATE_CACHE(re, s)
      646.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:645:5: 
      643.     register int tmp;
      644.     OPEN_READER(re, s)
      645.     UPDATE_CACHE(re, s)
               ^
      646.     tmp= SHOW_UBITS(re, s, n);
      647.     LAST_SKIP_BITS(re, s, n)

static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header_size)
{
    GetBitContext hb;
    int len;
    int chunk_size;
    short wave_format;
    init_get_bits(&hb, header, header_size*8);
    if (get_le32(&hb) != MKTAG('R','I','F','F')) {
        av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
        return -1;
    }
    chunk_size = get_le32(&hb);
    if (get_le32(&hb) != MKTAG('W','A','V','E')) {
        av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n");
        return -1;
    }
    while (get_le32(&hb) != MKTAG('f','m','t',' ')) {
        len = get_le32(&hb);
        skip_bits(&hb, 8*len);
    }
    len = get_le32(&hb);
    if (len < 16) {
        av_log(avctx, AV_LOG_ERROR, "fmt chunk was too short\n");
        return -1;
    }
    wave_format = get_le16(&hb);
    switch (wave_format) {
        case WAVE_FORMAT_PCM:
            break;
        default:
            av_log(avctx, AV_LOG_ERROR, "unsupported wave format\n");
            return -1;
    }
    avctx->channels = get_le16(&hb);
    avctx->sample_rate = get_le32(&hb);
    avctx->bit_rate = get_le32(&hb) * 8;
    avctx->block_align = get_le16(&hb);
    avctx->bits_per_coded_sample = get_le16(&hb);
    if (avctx->bits_per_coded_sample != 16) {
        av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n");
        return -1;
    }
    len -= 16;
    if (len > 0)
        av_log(avctx, AV_LOG_INFO, "%d header bytes unparsed\n", len);
    return 0;
}
['static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header_size)\n{\n    GetBitContext hb;\n    int len;\n    int chunk_size;\n    short wave_format;\n    init_get_bits(&hb, header, header_size*8);\n    if (get_le32(&hb) != MKTAG(\'R\',\'I\',\'F\',\'F\')) {\n        av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\\n");\n        return -1;\n    }\n    chunk_size = get_le32(&hb);\n    if (get_le32(&hb) != MKTAG(\'W\',\'A\',\'V\',\'E\')) {\n        av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\\n");\n        return -1;\n    }\n    while (get_le32(&hb) != MKTAG(\'f\',\'m\',\'t\',\' \')) {\n        len = get_le32(&hb);\n        skip_bits(&hb, 8*len);\n    }\n    len = get_le32(&hb);\n    if (len < 16) {\n        av_log(avctx, AV_LOG_ERROR, "fmt chunk was too short\\n");\n        return -1;\n    }\n    wave_format = get_le16(&hb);\n    switch (wave_format) {\n        case WAVE_FORMAT_PCM:\n            break;\n        default:\n            av_log(avctx, AV_LOG_ERROR, "unsupported wave format\\n");\n            return -1;\n    }\n    avctx->channels = get_le16(&hb);\n    avctx->sample_rate = get_le32(&hb);\n    avctx->bit_rate = get_le32(&hb) * 8;\n    avctx->block_align = get_le16(&hb);\n    avctx->bits_per_coded_sample = get_le16(&hb);\n    if (avctx->bits_per_coded_sample != 16) {\n        av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\\n");\n        return -1;\n    }\n    len -= 16;\n    if (len > 0)\n        av_log(avctx, AV_LOG_INFO, "%d header bytes unparsed\\n", len);\n    return 0;\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 int get_le32(GetBitContext *gb)\n{\n    return bswap_32(get_bits_long(gb, 32));\n}', 'static inline unsigned int get_bits_long(GetBitContext *s, int n){\n    if(n<=17) return get_bits(s, n);\n    else{\n#ifdef ALT_BITSTREAM_READER_LE\n        int ret= get_bits(s, 16);\n        return ret | (get_bits(s, n-16) << 16);\n#else\n        int ret= get_bits(s, 16) << (n-16);\n        return ret | get_bits(s, n-16);\n#endif\n    }\n}', 'static inline unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    tmp= SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n    return tmp;\n}']