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

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

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

libavformat/rtmpproto.c:408:5: 
406.     int i;
407. 
408.     sha = av_mallocz(av_sha_size);
         ^
409. 
410.     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:410:9: Taking false branch
408.     sha = av_mallocz(av_sha_size);
409. 
410.     if (keylen < 64) {
             ^
411.         memcpy(hmac_buf, key, keylen);
412.     } else {

libavformat/rtmpproto.c:413:9: 
411.         memcpy(hmac_buf, key, keylen);
412.     } else {
413.         av_sha_init(sha, 256);
             ^
414.         av_sha_update(sha,key, keylen);
415.         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
