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

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

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

libavutil/ppc/intreadwrite.h:44:1: start of procedure AV_RL32()
  42. 
  43. #define AV_RL32 AV_RL32
  44. static av_always_inline uint32_t AV_RL32(const void *p)
      ^
  45. {
  46.     uint32_t v;

libavutil/ppc/intreadwrite.h:47:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  45. {
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
          ^
  48.     return v;
  49. }

libavutil/ppc/intreadwrite.h:48:5: 
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
          ^
  49. }
  50. 

libavutil/ppc/intreadwrite.h:49:1: return from a call to AV_RL32
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
  49. }
      ^
  50. 
  51. #define AV_WL32 AV_WL32

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

libavutil/ppc/intreadwrite.h:44:1: start of procedure AV_RL32()
  42. 
  43. #define AV_RL32 AV_RL32
  44. static av_always_inline uint32_t AV_RL32(const void *p)
      ^
  45. {
  46.     uint32_t v;

libavutil/ppc/intreadwrite.h:47:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  45. {
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
          ^
  48.     return v;
  49. }

libavutil/ppc/intreadwrite.h:48:5: 
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
          ^
  49. }
  50. 

libavutil/ppc/intreadwrite.h:49:1: return from a call to AV_RL32
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
  49. }
      ^
  50. 
  51. #define AV_WL32 AV_WL32

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

libavutil/ppc/intreadwrite.h:44:1: start of procedure AV_RL32()
  42. 
  43. #define AV_RL32 AV_RL32
  44. static av_always_inline uint32_t AV_RL32(const void *p)
      ^
  45. {
  46.     uint32_t v;

libavutil/ppc/intreadwrite.h:47:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  45. {
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
          ^
  48.     return v;
  49. }

libavutil/ppc/intreadwrite.h:48:5: 
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
          ^
  49. }
  50. 

libavutil/ppc/intreadwrite.h:49:1: return from a call to AV_RL32
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
  49. }
      ^
  50. 
  51. #define AV_WL32 AV_WL32

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

libavutil/ppc/intreadwrite.h:44:1: start of procedure AV_RL32()
  42. 
  43. #define AV_RL32 AV_RL32
  44. static av_always_inline uint32_t AV_RL32(const void *p)
      ^
  45. {
  46.     uint32_t v;

libavutil/ppc/intreadwrite.h:47:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  45. {
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
          ^
  48.     return v;
  49. }

libavutil/ppc/intreadwrite.h:48:5: 
  46.     uint32_t v;
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
          ^
  49. }
  50. 

libavutil/ppc/intreadwrite.h:49:1: return from a call to AV_RL32
  47.     __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
  48.     return v;
  49. }
      ^
  50. 
  51. #define AV_WL32 AV_WL32

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

libavcodec/get_bits.h:375:1: start of procedure init_get_bits()
  373.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  374.  */
  375. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  376.                                 int bit_size)
  377. {

libavcodec/get_bits.h:379:5: 
  377. {
  378.     int buffer_size;
  379.     int ret = 0;
           ^
  380. 
  381.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {

libavcodec/get_bits.h:381:9: Taking false branch
  379.     int ret = 0;
  380. 
  381.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
               ^
  382.         buffer_size = bit_size = 0;
  383.         buffer      = NULL;

libavcodec/get_bits.h:381:35: Taking false branch
  379.     int ret = 0;
  380. 
  381.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
                                         ^
  382.         buffer_size = bit_size = 0;
  383.         buffer      = NULL;

libavcodec/get_bits.h:381:52: Taking false branch
  379.     int ret = 0;
  380. 
  381.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
                                                          ^
  382.         buffer_size = bit_size = 0;
  383.         buffer      = NULL;

libavcodec/get_bits.h:387:5: 
  385.     }
  386. 
  387.     buffer_size = (bit_size + 7) >> 3;
           ^
  388. 
  389.     s->buffer             = buffer;

libavcodec/get_bits.h:389:5: 
  387.     buffer_size = (bit_size + 7) >> 3;
  388. 
  389.     s->buffer             = buffer;
           ^
  390.     s->size_in_bits       = bit_size;
  391. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:390:5: 
  388. 
  389.     s->buffer             = buffer;
  390.     s->size_in_bits       = bit_size;
           ^
  391. #if !UNCHECKED_BITSTREAM_READER
  392.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:392:5: 
  390.     s->size_in_bits       = bit_size;
  391. #if !UNCHECKED_BITSTREAM_READER
  392.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  393. #endif
  394.     s->buffer_end         = buffer + buffer_size;

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

libavcodec/get_bits.h:395:5: 
  393. #endif
  394.     s->buffer_end         = buffer + buffer_size;
  395.     s->index              = 0;
           ^
  396. 
  397.     return ret;

libavcodec/get_bits.h:397:5: 
  395.     s->index              = 0;
  396. 
  397.     return ret;
           ^
  398. }
  399. 

libavcodec/get_bits.h:398:1: return from a call to init_get_bits
  396. 
  397.     return ret;
  398. }
       ^
  399. 
  400. /**

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

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

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

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

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

libavcodec/get_bits.h:277:5: 
  275. #ifdef BITSTREAM_READER_LE
  276.     result >>= index & 7;
  277.     result  &= 1;
           ^
  278. #else
  279.     result <<= index & 7;

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

libavcodec/get_bits.h:286:5: 
  284. #endif
  285.         index++;
  286.     s->index = index;
           ^
  287. 
  288.     return result;

libavcodec/get_bits.h:288:5: 
  286.     s->index = index;
  287. 
  288.     return result;
           ^
  289. }
  290. 

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

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

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

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

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

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

libavutil/mem.c:69:9: Taking false branch
  67. 
  68.     /* let's disallow possibly ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
              ^
  70.         return NULL;
  71. 

libavutil/mem.c:69:35: Taking false branch
  67. 
  68.     /* let's disallow possibly ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
                                        ^
  70.         return NULL;
  71. 

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

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

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

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

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