libavcodec/psymodel.c:37: error: Null Dereference
  pointer `ctx->num_bands` last assigned on line 35 could be null and is dereferenced by call to `memcpy()` at line 37, column 5.

libavcodec/psymodel.c:28:9: start of procedure ff_psy_init()
26. extern const FFPsyModel ff_aac_psy_model;
27. 
28. av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx,
            ^
29.                         int num_lens,
30.                         const uint8_t **bands, const int* num_bands)

libavcodec/psymodel.c:32:5: 
30.                         const uint8_t **bands, const int* num_bands)
31. {
32.     ctx->avctx = avctx;
        ^
33.     ctx->psy_bands = av_mallocz(sizeof(FFPsyBand) * PSY_MAX_BANDS * avctx->channels);
34.     ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);

libavcodec/psymodel.c:33:5: 
31. {
32.     ctx->avctx = avctx;
33.     ctx->psy_bands = av_mallocz(sizeof(FFPsyBand) * PSY_MAX_BANDS * avctx->channels);
        ^
34.     ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);
35.     ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);

libavutil/mem.c:156:1: start of procedure av_mallocz()
  154. }
  155. 
  156. void *av_mallocz(size_t size)
       ^
  157. {
  158.     void *ptr = av_malloc(size);

libavutil/mem.c:158:5: 
  156. void *av_mallocz(size_t size)
  157. {
  158.     void *ptr = av_malloc(size);
           ^
  159.     if (ptr)
  160.         memset(ptr, 0, size);

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 true branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:73:9: 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
    73.         return NULL;
                ^
    74. 
    75. #if CONFIG_MEMALIGN_HACK

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)

libavutil/mem.c:159:9: Taking false branch
  157. {
  158.     void *ptr = av_malloc(size);
  159.     if (ptr)
               ^
  160.         memset(ptr, 0, size);
  161.     return ptr;

libavutil/mem.c:161:5: 
  159.     if (ptr)
  160.         memset(ptr, 0, size);
  161.     return ptr;
           ^
  162. }
  163. 

libavutil/mem.c:162:1: return from a call to av_mallocz
  160.         memset(ptr, 0, size);
  161.     return ptr;
  162. }
       ^
  163. 
  164. char *av_strdup(const char *s)

libavcodec/psymodel.c:34:5: 
32.     ctx->avctx = avctx;
33.     ctx->psy_bands = av_mallocz(sizeof(FFPsyBand) * PSY_MAX_BANDS * avctx->channels);
34.     ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);
        ^
35.     ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
36.     memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);

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-16) )
             ^
  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,16,size))
              ^
  84.         ptr = NULL;
  85. #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/psymodel.c:35:5: 
33.     ctx->psy_bands = av_mallocz(sizeof(FFPsyBand) * PSY_MAX_BANDS * avctx->channels);
34.     ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);
35.     ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
        ^
36.     memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);
37.     memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);

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 true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

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/psymodel.c:36:5: 
34.     ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);
35.     ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
36.     memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);
        ^
37.     memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);
38.     switch (ctx->avctx->codec_id) {

libavcodec/psymodel.c:37:5: 
35.     ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
36.     memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);
37.     memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);
        ^
38.     switch (ctx->avctx->codec_id) {
39.     case CODEC_ID_AAC:
