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

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

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

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

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

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

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

libavcodec/get_bits.h:352:1: start of procedure init_get_bits()
  350.  * @param bit_size the size of the buffer in bits
  351.  */
  352. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  353.                                  int bit_size)
  354. {

libavcodec/get_bits.h:355:5: 
  353.                                  int bit_size)
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
           ^
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:356:9: Taking false branch
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
               ^
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;

libavcodec/get_bits.h:356:28: Taking false branch
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
                                  ^
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;

libavcodec/get_bits.h:361:5: 
  359.     }
  360. 
  361.     s->buffer       = buffer;
           ^
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:362:5: 
  360. 
  361.     s->buffer       = buffer;
  362.     s->size_in_bits = bit_size;
           ^
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:364:5: 
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:366:5: 
  364.     s->size_in_bits_plus8 = bit_size + 8;
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
           ^
  367.     s->index        = 0;
  368. }

libavcodec/get_bits.h:367:5: 
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
           ^
  368. }
  369. 

libavcodec/get_bits.h:368:1: return from a call to init_get_bits
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
  368. }
       ^
  369. 
  370. static inline void align_get_bits(GetBitContext *s)

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

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
  266. }
  267. 
  268. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  269. {
  270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
  268. static inline unsigned int get_bits1(GetBitContext *s)
  269. {
  270.     unsigned int index = s->index;
           ^
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
  269. {
  270.     unsigned int index = s->index;
  271.     uint8_t result = s->buffer[index>>3];
           ^
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;

libavcodec/get_bits.h:273:5: 
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
           ^
  274.     result &= 1;
  275. #else

libavcodec/get_bits.h:274:5: 
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
  274.     result &= 1;
           ^
  275. #else
  276.     result <<= index & 7;

libavcodec/get_bits.h:280:9: Taking false branch
  278. #endif
  279. #if !UNCHECKED_BITSTREAM_READER
  280.     if (s->index < s->size_in_bits_plus8)
               ^
  281. #endif
  282.         index++;

libavcodec/get_bits.h:283:5: 
  281. #endif
  282.         index++;
  283.     s->index = index;
           ^
  284. 
  285.     return result;

libavcodec/get_bits.h:285:5: 
  283.     s->index = index;
  284. 
  285.     return result;
           ^
  286. }
  287. 

libavcodec/get_bits.h:286:1: return from a call to get_bits1
  284. 
  285.     return result;
  286. }
       ^
  287. 
  288. static inline unsigned int show_bits1(GetBitContext *s)

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

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

libavcodec/smacker.c:289:9: 
287.     if(!get_bits1(&gb)) {
288.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
289.         smk->mmap_tbl = av_malloc(sizeof(int) * 2);
             ^
290.         smk->mmap_tbl[0] = 0;
291.         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:9: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:72:33: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
                                      ^
  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_ALIGNED_MALLOC

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

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

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

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

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

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
  266. }
  267. 
  268. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  269. {
  270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
  268. static inline unsigned int get_bits1(GetBitContext *s)
  269. {
  270.     unsigned int index = s->index;
           ^
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
  269. {
  270.     unsigned int index = s->index;
  271.     uint8_t result = s->buffer[index>>3];
           ^
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;

libavcodec/get_bits.h:273:5: 
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
           ^
  274.     result &= 1;
  275. #else

libavcodec/get_bits.h:274:5: 
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
  274.     result &= 1;
           ^
  275. #else
  276.     result <<= index & 7;

libavcodec/get_bits.h:280:9: Taking false branch
  278. #endif
  279. #if !UNCHECKED_BITSTREAM_READER
  280.     if (s->index < s->size_in_bits_plus8)
               ^
  281. #endif
  282.         index++;

libavcodec/get_bits.h:283:5: 
  281. #endif
  282.         index++;
  283.     s->index = index;
           ^
  284. 
  285.     return result;

libavcodec/get_bits.h:285:5: 
  283.     s->index = index;
  284. 
  285.     return result;
           ^
  286. }
  287. 

libavcodec/get_bits.h:286:1: return from a call to get_bits1
  284. 
  285.     return result;
  286. }
       ^
  287. 
  288. static inline unsigned int show_bits1(GetBitContext *s)

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

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

libavcodec/smacker.c:298:9: 
296.     if(!get_bits1(&gb)) {
297.         av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
298.         smk->mclr_tbl = av_malloc(sizeof(int) * 2);
             ^
299.         smk->mclr_tbl[0] = 0;
300.         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:9: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:72:33: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
                                      ^
  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_ALIGNED_MALLOC

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

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

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

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

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

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
  266. }
  267. 
  268. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  269. {
  270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
  268. static inline unsigned int get_bits1(GetBitContext *s)
  269. {
  270.     unsigned int index = s->index;
           ^
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
  269. {
  270.     unsigned int index = s->index;
  271.     uint8_t result = s->buffer[index>>3];
           ^
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;

libavcodec/get_bits.h:273:5: 
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
           ^
  274.     result &= 1;
  275. #else

libavcodec/get_bits.h:274:5: 
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
  274.     result &= 1;
           ^
  275. #else
  276.     result <<= index & 7;

libavcodec/get_bits.h:280:9: Taking false branch
  278. #endif
  279. #if !UNCHECKED_BITSTREAM_READER
  280.     if (s->index < s->size_in_bits_plus8)
               ^
  281. #endif
  282.         index++;

libavcodec/get_bits.h:283:5: 
  281. #endif
  282.         index++;
  283.     s->index = index;
           ^
  284. 
  285.     return result;

libavcodec/get_bits.h:285:5: 
  283.     s->index = index;
  284. 
  285.     return result;
           ^
  286. }
  287. 

libavcodec/get_bits.h:286:1: return from a call to get_bits1
  284. 
  285.     return result;
  286. }
       ^
  287. 
  288. static inline unsigned int show_bits1(GetBitContext *s)

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

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

libavcodec/smacker.c:307:9: 
305.     if(!get_bits1(&gb)) {
306.         av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
307.         smk->full_tbl = av_malloc(sizeof(int) * 2);
             ^
308.         smk->full_tbl[0] = 0;
309.         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:9: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:72:33: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
                                      ^
  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_ALIGNED_MALLOC

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

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

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

libavcodec/smacker.c:309:9: 
307.         smk->full_tbl = av_malloc(sizeof(int) * 2);
308.         smk->full_tbl[0] = 0;
309.         smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
             ^
310.     } else {
311.         if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))

libavcodec/smacker.c:314:9: 
312.             return -1;
313.     }
314.     if(!get_bits1(&gb)) {
             ^
315.         av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
316.         smk->type_tbl = av_malloc(sizeof(int) * 2);

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
  266. }
  267. 
  268. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  269. {
  270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
  268. static inline unsigned int get_bits1(GetBitContext *s)
  269. {
  270.     unsigned int index = s->index;
           ^
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
  269. {
  270.     unsigned int index = s->index;
  271.     uint8_t result = s->buffer[index>>3];
           ^
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;

libavcodec/get_bits.h:273:5: 
  271.     uint8_t result = s->buffer[index>>3];
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
           ^
  274.     result &= 1;
  275. #else

libavcodec/get_bits.h:274:5: 
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
  274.     result &= 1;
           ^
  275. #else
  276.     result <<= index & 7;

libavcodec/get_bits.h:280:9: Taking false branch
  278. #endif
  279. #if !UNCHECKED_BITSTREAM_READER
  280.     if (s->index < s->size_in_bits_plus8)
               ^
  281. #endif
  282.         index++;

libavcodec/get_bits.h:283:5: 
  281. #endif
  282.         index++;
  283.     s->index = index;
           ^
  284. 
  285.     return result;

libavcodec/get_bits.h:285:5: 
  283.     s->index = index;
  284. 
  285.     return result;
           ^
  286. }
  287. 

libavcodec/get_bits.h:286:1: return from a call to get_bits1
  284. 
  285.     return result;
  286. }
       ^
  287. 
  288. static inline unsigned int show_bits1(GetBitContext *s)

libavcodec/smacker.c:314:9: Taking true branch
312.             return -1;
313.     }
314.     if(!get_bits1(&gb)) {
             ^
315.         av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
316.         smk->type_tbl = av_malloc(sizeof(int) * 2);

libavcodec/smacker.c:315:9: Skipping av_log(): empty list of specs
313.     }
314.     if(!get_bits1(&gb)) {
315.         av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
             ^
316.         smk->type_tbl = av_malloc(sizeof(int) * 2);
317.         smk->type_tbl[0] = 0;

libavcodec/smacker.c:316:9: 
314.     if(!get_bits1(&gb)) {
315.         av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
316.         smk->type_tbl = av_malloc(sizeof(int) * 2);
             ^
317.         smk->type_tbl[0] = 0;
318.         smk->type_last[0] = smk->type_last[1] = smk->type_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:9: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:72:33: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
                                      ^
  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_ALIGNED_MALLOC

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

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

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

libavcodec/smacker.c:317:9: 
315.         av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
316.         smk->type_tbl = av_malloc(sizeof(int) * 2);
317.         smk->type_tbl[0] = 0;
             ^
318.         smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
319.     } else {

static int decode_header_trees(SmackVContext *smk) {
    GetBitContext gb;
    int mmap_size, mclr_size, full_size, type_size;
    mmap_size = AV_RL32(smk->avctx->extradata);
    mclr_size = AV_RL32(smk->avctx->extradata + 4);
    full_size = AV_RL32(smk->avctx->extradata + 8);
    type_size = AV_RL32(smk->avctx->extradata + 12);
    init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
    if(!get_bits1(&gb)) {
        av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
        smk->mmap_tbl = av_malloc(sizeof(int) * 2);
        smk->mmap_tbl[0] = 0;
        smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
    } else {
        if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))
            return -1;
    }
    if(!get_bits1(&gb)) {
        av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
        smk->mclr_tbl = av_malloc(sizeof(int) * 2);
        smk->mclr_tbl[0] = 0;
        smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
    } else {
        if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))
            return -1;
    }
    if(!get_bits1(&gb)) {
        av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
        smk->full_tbl = av_malloc(sizeof(int) * 2);
        smk->full_tbl[0] = 0;
        smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
    } else {
        if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))
            return -1;
    }
    if(!get_bits1(&gb)) {
        av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
        smk->type_tbl = av_malloc(sizeof(int) * 2);
        smk->type_tbl[0] = 0;
        smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
    } else {
        if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size))
            return -1;
    }
    return 0;
}
['static int decode_header_trees(SmackVContext *smk) {\n    GetBitContext gb;\n    int mmap_size, mclr_size, full_size, type_size;\n    mmap_size = AV_RL32(smk->avctx->extradata);\n    mclr_size = AV_RL32(smk->avctx->extradata + 4);\n    full_size = AV_RL32(smk->avctx->extradata + 8);\n    type_size = AV_RL32(smk->avctx->extradata + 12);\n    init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);\n    if(!get_bits1(&gb)) {\n        av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\\n");\n        smk->mmap_tbl = av_malloc(sizeof(int) * 2);\n        smk->mmap_tbl[0] = 0;\n        smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;\n    } else {\n        if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))\n            return -1;\n    }\n    if(!get_bits1(&gb)) {\n        av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\\n");\n        smk->mclr_tbl = av_malloc(sizeof(int) * 2);\n        smk->mclr_tbl[0] = 0;\n        smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;\n    } else {\n        if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))\n            return -1;\n    }\n    if(!get_bits1(&gb)) {\n        av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\\n");\n        smk->full_tbl = av_malloc(sizeof(int) * 2);\n        smk->full_tbl[0] = 0;\n        smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;\n    } else {\n        if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))\n            return -1;\n    }\n    if(!get_bits1(&gb)) {\n        av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\\n");\n        smk->type_tbl = av_malloc(sizeof(int) * 2);\n        smk->type_tbl[0] = 0;\n        smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;\n    } else {\n        if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size))\n            return -1;\n    }\n    return 0;\n}', 'static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,\n                                 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#if !UNCHECKED_BITSTREAM_READER\n    s->size_in_bits_plus8 = bit_size + 8;\n#endif\n    s->buffer_end   = buffer + buffer_size;\n    s->index        = 0;\n}', 'static inline unsigned int get_bits1(GetBitContext *s)\n{\n    unsigned int index = s->index;\n    uint8_t result = s->buffer[index>>3];\n#ifdef BITSTREAM_READER_LE\n    result >>= index & 7;\n    result &= 1;\n#else\n    result <<= index & 7;\n    result >>= 8 - 1;\n#endif\n#if !UNCHECKED_BITSTREAM_READER\n    if (s->index < s->size_in_bits_plus8)\n#endif\n        index++;\n    s->index = index;\n    return result;\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if (size > (INT_MAX-32) || !size)\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+32);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&31) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,32,size))\n        ptr = NULL;\n#elif HAVE_ALIGNED_MALLOC\n    ptr = _aligned_malloc(size, 32);\n#elif HAVE_MEMALIGN\n    ptr = memalign(32,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']