libavformat/rtmpproto.c:387: error: Null Dereference
  pointer `sha` last assigned on line 382 could be null and is dereferenced by call to `av_sha_init()` at line 387, column 9.

libavformat/rtmpproto.c:375:1: start of procedure rtmp_calc_digest()
373.  * @param dst    buffer where calculated digest will be stored (32 bytes)
374.  */
375. static void rtmp_calc_digest(const uint8_t *src, int len, int gap,
     ^
376.                              const uint8_t *key, int keylen, uint8_t *dst)
377. {

libavformat/rtmpproto.c:379:5: 
377. {
378.     struct AVSHA *sha;
379.     uint8_t hmac_buf[64+32] = {0};
         ^
380.     int i;
381. 

libavformat/rtmpproto.c:382:5: 
380.     int i;
381. 
382.     sha = av_mallocz(av_sha_size);
         ^
383. 
384.     if (keylen < 64) {

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

libavutil/mem.c:156:5: 
  154. void *av_mallocz(size_t size)
  155. {
  156.     void *ptr = av_malloc(size);
           ^
  157.     if (ptr)
  158.         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-32) )
               ^
    73.         return NULL;
    74. 

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

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)

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

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

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

libavformat/rtmpproto.c:384:9: Taking false branch
382.     sha = av_mallocz(av_sha_size);
383. 
384.     if (keylen < 64) {
             ^
385.         memcpy(hmac_buf, key, keylen);
386.     } else {

libavformat/rtmpproto.c:387:9: 
385.         memcpy(hmac_buf, key, keylen);
386.     } else {
387.         av_sha_init(sha, 256);
             ^
388.         av_sha_update(sha,key, keylen);
389.         av_sha_final(sha, hmac_buf);

libavutil/sha.c:245:1: start of procedure av_sha_init()
  243. 
  244. 
  245. int av_sha_init(AVSHA* ctx, int bits)
       ^
  246. {
  247.     ctx->digest_len = bits >> 5;

libavutil/sha.c:247:5: 
  245. int av_sha_init(AVSHA* ctx, int bits)
  246. {
  247.     ctx->digest_len = bits >> 5;
           ^
  248.     switch (bits) {
  249.     case 160: // SHA-1
