libavcodec/bgmc.c:470: error: Null Dereference
  pointer `*cf_lut_status` last assigned on line 462 could be null and is dereferenced by call to `memset()` at line 470, column 9.

libavcodec/bgmc.c:459:1: start of procedure ff_bgmc_init()
457. 
458. /** Initialize the lookup table arrays */
459. int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status)
     ^
460. {
461.     *cf_lut        = av_malloc(sizeof(*cf_lut)        * LUT_BUFF * 16 * LUT_SIZE);

libavcodec/bgmc.c:461:5: 
459. int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status)
460. {
461.     *cf_lut        = av_malloc(sizeof(*cf_lut)        * LUT_BUFF * 16 * LUT_SIZE);
         ^
462.     *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
463. 

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:71:5: 
  69. #endif
  70. 
  71.     assert(size);
          ^
  72. 
  73.     /* let's disallow possible ambiguous cases */

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

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

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

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/bgmc.c:462:5: 
460. {
461.     *cf_lut        = av_malloc(sizeof(*cf_lut)        * LUT_BUFF * 16 * LUT_SIZE);
462.     *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
         ^
463. 
464.     if (!cf_lut || !cf_lut_status) {

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:71:5: 
  69. #endif
  70. 
  71.     assert(size);
          ^
  72. 
  73.     /* let's disallow possible ambiguous cases */

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

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

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

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

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/bgmc.c:464:10: Taking false branch
462.     *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
463. 
464.     if (!cf_lut || !cf_lut_status) {
              ^
465.         ff_bgmc_end(cf_lut, cf_lut_status);
466.         av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");

libavcodec/bgmc.c:464:21: Taking false branch
462.     *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
463. 
464.     if (!cf_lut || !cf_lut_status) {
                         ^
465.         ff_bgmc_end(cf_lut, cf_lut_status);
466.         av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");

libavcodec/bgmc.c:470:9: 
468.     } else {
469.         // initialize lut_status buffer to a value never used to compare against
470.         memset(*cf_lut_status, -1, sizeof(*cf_lut_status) * LUT_BUFF);
             ^
471.     }
472. 
