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

libavformat/rtmpproto.c:355:1: start of procedure rtmp_calc_digest()
353.  * @param dst    buffer where calculated digest will be stored (32 bytes)
354.  */
355. static void rtmp_calc_digest(const uint8_t *src, int len, int gap,
     ^
356.                              const uint8_t *key, int keylen, uint8_t *dst)
357. {

libavformat/rtmpproto.c:359:5: 
357. {
358.     struct AVSHA *sha;
359.     uint8_t hmac_buf[64+32] = {0};
         ^
360.     int i;
361. 

libavformat/rtmpproto.c:362:5: 
360.     int i;
361. 
362.     sha = av_mallocz(av_sha_size);
         ^
363. 
364.     if (keylen < 64) {

libavutil/mem.c:140:1: start of procedure av_mallocz()
  138. }
  139. 
  140. void *av_mallocz(unsigned int size)
       ^
  141. {
  142.     void *ptr = av_malloc(size);

libavutil/mem.c:142:5: 
  140. void *av_mallocz(unsigned int size)
  141. {
  142.     void *ptr = av_malloc(size);
           ^
  143.     if (ptr)
  144.         memset(ptr, 0, size);

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking true branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:56:9: 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
    56.         return NULL;
                ^
    57. 
    58. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:100:1: return from a call to av_malloc
     98. #endif
     99.     return ptr;
    100. }
         ^
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:143:9: Taking false branch
  141. {
  142.     void *ptr = av_malloc(size);
  143.     if (ptr)
               ^
  144.         memset(ptr, 0, size);
  145.     return ptr;

libavutil/mem.c:145:5: 
  143.     if (ptr)
  144.         memset(ptr, 0, size);
  145.     return ptr;
           ^
  146. }
  147. 

libavutil/mem.c:146:1: return from a call to av_mallocz
  144.         memset(ptr, 0, size);
  145.     return ptr;
  146. }
       ^
  147. 
  148. char *av_strdup(const char *s)

libavformat/rtmpproto.c:364:9: Taking false branch
362.     sha = av_mallocz(av_sha_size);
363. 
364.     if (keylen < 64) {
             ^
365.         memcpy(hmac_buf, key, keylen);
366.     } else {

libavformat/rtmpproto.c:367:9: 
365.         memcpy(hmac_buf, key, keylen);
366.     } else {
367.         av_sha_init(sha, 256);
             ^
368.         av_sha_update(sha,key, keylen);
369.         av_sha_final(sha, hmac_buf);

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

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