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

libavformat/rtmpproto.c:399:1: start of procedure rtmp_calc_digest()
397.  * @param dst    buffer where calculated digest will be stored (32 bytes)
398.  */
399. static void rtmp_calc_digest(const uint8_t *src, int len, int gap,
     ^
400.                              const uint8_t *key, int keylen, uint8_t *dst)
401. {

libavformat/rtmpproto.c:403:5: 
401. {
402.     struct AVSHA *sha;
403.     uint8_t hmac_buf[64+32] = {0};
         ^
404.     int i;
405. 

libavformat/rtmpproto.c:406:5: 
404.     int i;
405. 
406.     sha = av_mallocz(av_sha_size);
         ^
407. 
408.     if (keylen < 64) {

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

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

libavutil/mem.c:75:9: 
    73.     /* let's disallow possible ambiguous cases */
    74.     if (size > (INT_MAX-32) || !size)
    75.         return NULL;
                ^
    76. 
    77. #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)

libavformat/rtmpproto.c:408:9: Taking false branch
406.     sha = av_mallocz(av_sha_size);
407. 
408.     if (keylen < 64) {
             ^
409.         memcpy(hmac_buf, key, keylen);
410.     } else {

libavformat/rtmpproto.c:411:9: 
409.         memcpy(hmac_buf, key, keylen);
410.     } else {
411.         av_sha_init(sha, 256);
             ^
412.         av_sha_update(sha,key, keylen);
413.         av_sha_final(sha, hmac_buf);

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

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