libavcodec/smacker.c:310: error: Null Dereference
  pointer `smk->full_tbl` last assigned on line 309 could be null and is dereferenced at line 310, column 9.

libavcodec/smacker.c:278:1: start of procedure decode_header_trees()
276. }
277. 
278. static int decode_header_trees(SmackVContext *smk) {
     ^
279.     GetBitContext gb;
280.     int mmap_size, mclr_size, full_size, type_size;

libavcodec/smacker.c:282:5: 
280.     int mmap_size, mclr_size, full_size, type_size;
281. 
282.     mmap_size = AV_RL32(smk->avctx->extradata);
         ^
283.     mclr_size = AV_RL32(smk->avctx->extradata + 4);
284.     full_size = AV_RL32(smk->avctx->extradata + 8);

libavcodec/smacker.c:283:5: 
281. 
282.     mmap_size = AV_RL32(smk->avctx->extradata);
283.     mclr_size = AV_RL32(smk->avctx->extradata + 4);
         ^
284.     full_size = AV_RL32(smk->avctx->extradata + 8);
285.     type_size = AV_RL32(smk->avctx->extradata + 12);

libavcodec/smacker.c:284:5: 
282.     mmap_size = AV_RL32(smk->avctx->extradata);
283.     mclr_size = AV_RL32(smk->avctx->extradata + 4);
284.     full_size = AV_RL32(smk->avctx->extradata + 8);
         ^
285.     type_size = AV_RL32(smk->avctx->extradata + 12);
286. 

libavcodec/smacker.c:285:5: 
283.     mclr_size = AV_RL32(smk->avctx->extradata + 4);
284.     full_size = AV_RL32(smk->avctx->extradata + 8);
285.     type_size = AV_RL32(smk->avctx->extradata + 12);
         ^
286. 
287.     init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);

libavcodec/smacker.c:287:5: 
285.     type_size = AV_RL32(smk->avctx->extradata + 12);
286. 
287.     init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
         ^
288. 
289.     if(!get_bits1(&gb)) {

libavcodec/get_bits.h:383:1: start of procedure init_get_bits()
  381.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  382.  */
  383. static inline void init_get_bits(GetBitContext *s,
       ^
  384.                    const uint8_t *buffer, int bit_size)
  385. {

libavcodec/get_bits.h:386:5: 
  384.                    const uint8_t *buffer, int bit_size)
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
           ^
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:387:9: Taking false branch
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
               ^
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;

libavcodec/get_bits.h:387:28: Taking false branch
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
                                  ^
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;

libavcodec/get_bits.h:392:5: 
  390.     }
  391. 
  392.     s->buffer       = buffer;
           ^
  393.     s->size_in_bits = bit_size;
  394.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:393:5: 
  391. 
  392.     s->buffer       = buffer;
  393.     s->size_in_bits = bit_size;
           ^
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:394:5: 
  392.     s->buffer       = buffer;
  393.     s->size_in_bits = bit_size;
  394.     s->buffer_end   = buffer + buffer_size;
           ^
  395. #ifdef ALT_BITSTREAM_READER
  396.     s->index        = 0;

libavcodec/get_bits.h:396:5: 
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER
  396.     s->index        = 0;
           ^
  397. #elif defined A32_BITSTREAM_READER
  398.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:402:1: return from a call to init_get_bits
  400.     skip_bits_long(s, 0);
  401. #endif
  402. }
       ^
  403. 
  404. static inline void align_get_bits(GetBitContext *s)

libavcodec/smacker.c:289:9: 
287.     init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
288. 
289.     if(!get_bits1(&gb)) {
             ^
290.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);

libavcodec/get_bits.h:303:1: start of procedure get_bits1()
  301. }
  302. 
  303. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
  303. static inline unsigned int get_bits1(GetBitContext *s){
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
           ^
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
  306.     uint8_t result = s->buffer[index>>3];
           ^
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;

libavcodec/get_bits.h:308:5: 
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
           ^
  309.     result &= 1;
  310. #else

libavcodec/get_bits.h:309:5: 
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
  309.     result &= 1;
           ^
  310. #else
  311.     result <<= index & 7;

libavcodec/get_bits.h:314:5: 
  312.     result >>= 8 - 1;
  313. #endif
  314.     index++;
           ^
  315.     s->index = index;
  316. 

libavcodec/get_bits.h:315:5: 
  313. #endif
  314.     index++;
  315.     s->index = index;
           ^
  316. 
  317.     return result;

libavcodec/get_bits.h:317:5: 
  315.     s->index = index;
  316. 
  317.     return result;
           ^
  318. #else
  319.     return get_bits(s, 1);

libavcodec/get_bits.h:321:1: return from a call to get_bits1
  319.     return get_bits(s, 1);
  320. #endif
  321. }
       ^
  322. 
  323. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/smacker.c:289:9: Taking true branch
287.     init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
288. 
289.     if(!get_bits1(&gb)) {
             ^
290.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);

libavcodec/smacker.c:290:9: Skipping av_log(): empty list of specs
288. 
289.     if(!get_bits1(&gb)) {
290.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
             ^
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292.         smk->mmap_tbl[0] = 0;

libavcodec/smacker.c:291:9: 
289.     if(!get_bits1(&gb)) {
290.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);
             ^
292.         smk->mmap_tbl[0] = 0;
293.         smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(size_t size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(size_t size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking false branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavcodec/smacker.c:292:9: 
290.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292.         smk->mmap_tbl[0] = 0;
             ^
293.         smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
294.     } else {

libavcodec/smacker.c:293:9: 
291.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292.         smk->mmap_tbl[0] = 0;
293.         smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
             ^
294.     } else {
295.         if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))

libavcodec/smacker.c:298:9: 
296.             return -1;
297.     }
298.     if(!get_bits1(&gb)) {
             ^
299.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);

libavcodec/get_bits.h:303:1: start of procedure get_bits1()
  301. }
  302. 
  303. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
  303. static inline unsigned int get_bits1(GetBitContext *s){
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
           ^
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
  306.     uint8_t result = s->buffer[index>>3];
           ^
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;

libavcodec/get_bits.h:308:5: 
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
           ^
  309.     result &= 1;
  310. #else

libavcodec/get_bits.h:309:5: 
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
  309.     result &= 1;
           ^
  310. #else
  311.     result <<= index & 7;

libavcodec/get_bits.h:314:5: 
  312.     result >>= 8 - 1;
  313. #endif
  314.     index++;
           ^
  315.     s->index = index;
  316. 

libavcodec/get_bits.h:315:5: 
  313. #endif
  314.     index++;
  315.     s->index = index;
           ^
  316. 
  317.     return result;

libavcodec/get_bits.h:317:5: 
  315.     s->index = index;
  316. 
  317.     return result;
           ^
  318. #else
  319.     return get_bits(s, 1);

libavcodec/get_bits.h:321:1: return from a call to get_bits1
  319.     return get_bits(s, 1);
  320. #endif
  321. }
       ^
  322. 
  323. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/smacker.c:298:9: Taking true branch
296.             return -1;
297.     }
298.     if(!get_bits1(&gb)) {
             ^
299.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);

libavcodec/smacker.c:299:9: Skipping av_log(): empty list of specs
297.     }
298.     if(!get_bits1(&gb)) {
299.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
             ^
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301.         smk->mclr_tbl[0] = 0;

libavcodec/smacker.c:300:9: 
298.     if(!get_bits1(&gb)) {
299.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);
             ^
301.         smk->mclr_tbl[0] = 0;
302.         smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(size_t size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(size_t size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking false branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavcodec/smacker.c:301:9: 
299.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301.         smk->mclr_tbl[0] = 0;
             ^
302.         smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
303.     } else {

libavcodec/smacker.c:302:9: 
300.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301.         smk->mclr_tbl[0] = 0;
302.         smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
             ^
303.     } else {
304.         if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))

libavcodec/smacker.c:307:9: 
305.             return -1;
306.     }
307.     if(!get_bits1(&gb)) {
             ^
308.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309.         smk->full_tbl = av_malloc(sizeof(int) * 2);

libavcodec/get_bits.h:303:1: start of procedure get_bits1()
  301. }
  302. 
  303. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
  303. static inline unsigned int get_bits1(GetBitContext *s){
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
           ^
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
  306.     uint8_t result = s->buffer[index>>3];
           ^
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;

libavcodec/get_bits.h:308:5: 
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
           ^
  309.     result &= 1;
  310. #else

libavcodec/get_bits.h:309:5: 
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
  309.     result &= 1;
           ^
  310. #else
  311.     result <<= index & 7;

libavcodec/get_bits.h:314:5: 
  312.     result >>= 8 - 1;
  313. #endif
  314.     index++;
           ^
  315.     s->index = index;
  316. 

libavcodec/get_bits.h:315:5: 
  313. #endif
  314.     index++;
  315.     s->index = index;
           ^
  316. 
  317.     return result;

libavcodec/get_bits.h:317:5: 
  315.     s->index = index;
  316. 
  317.     return result;
           ^
  318. #else
  319.     return get_bits(s, 1);

libavcodec/get_bits.h:321:1: return from a call to get_bits1
  319.     return get_bits(s, 1);
  320. #endif
  321. }
       ^
  322. 
  323. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/smacker.c:307:9: Taking true branch
305.             return -1;
306.     }
307.     if(!get_bits1(&gb)) {
             ^
308.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309.         smk->full_tbl = av_malloc(sizeof(int) * 2);

libavcodec/smacker.c:308:9: Skipping av_log(): empty list of specs
306.     }
307.     if(!get_bits1(&gb)) {
308.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
             ^
309.         smk->full_tbl = av_malloc(sizeof(int) * 2);
310.         smk->full_tbl[0] = 0;

libavcodec/smacker.c:309:9: 
307.     if(!get_bits1(&gb)) {
308.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309.         smk->full_tbl = av_malloc(sizeof(int) * 2);
             ^
310.         smk->full_tbl[0] = 0;
311.         smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(size_t size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(size_t size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking true branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:84:9: 
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
  84.         ptr = NULL;
              ^
  85. #elif HAVE_MEMALIGN
  86.     ptr = memalign(32,size);

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavcodec/smacker.c:310:9: 
308.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309.         smk->full_tbl = av_malloc(sizeof(int) * 2);
310.         smk->full_tbl[0] = 0;
             ^
311.         smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
312.     } else {
