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

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

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

libavformat/rtmpproto.c:379:5: 
377.     int i;
378. 
379.     sha = av_mallocz(av_sha_size);
         ^
380. 
381.     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:381:9: Taking false branch
379.     sha = av_mallocz(av_sha_size);
380. 
381.     if (keylen < 64) {
             ^
382.         memcpy(hmac_buf, key, keylen);
383.     } else {

libavformat/rtmpproto.c:384:9: 
382.         memcpy(hmac_buf, key, keylen);
383.     } else {
384.         av_sha_init(sha, 256);
             ^
385.         av_sha_update(sha,key, keylen);
386.         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
