libavcodec/wmaenc.c:66: error: Null Dereference
  pointer `extradata` last assigned on line 64 could be null and is dereferenced at line 66, column 9.

libavcodec/wmaenc.c:32:1: start of procedure encode_init()
30. 
31. 
32. static av_cold int encode_init(AVCodecContext *avctx)
    ^
33. {
34.     WMACodecContext *s = avctx->priv_data;

libavcodec/wmaenc.c:34:5: 
32. static av_cold int encode_init(AVCodecContext *avctx)
33. {
34.     WMACodecContext *s = avctx->priv_data;
        ^
35.     int i, flags1, flags2, block_align;
36.     uint8_t *extradata;

libavcodec/wmaenc.c:38:5: 
36.     uint8_t *extradata;
37. 
38.     s->avctx = avctx;
        ^
39. 
40.     if (avctx->channels > MAX_CHANNELS) {

libavcodec/wmaenc.c:40:9: Taking false branch
38.     s->avctx = avctx;
39. 
40.     if (avctx->channels > MAX_CHANNELS) {
            ^
41.         av_log(avctx, AV_LOG_ERROR,
42.                "too many channels: got %i, need %i or fewer",

libavcodec/wmaenc.c:47:9: Taking false branch
45.     }
46. 
47.     if (avctx->sample_rate > 48000) {
            ^
48.         av_log(avctx, AV_LOG_ERROR, "sample rate is too high: %d > 48kHz",
49.                avctx->sample_rate);

libavcodec/wmaenc.c:53:9: Taking false branch
51.     }
52. 
53.     if (avctx->bit_rate < 24 * 1000) {
            ^
54.         av_log(avctx, AV_LOG_ERROR,
55.                "bitrate too low: got %i, need 24000 or higher\n",

libavcodec/wmaenc.c:61:5: 
59. 
60.     /* extract flag infos */
61.     flags1 = 0;
        ^
62.     flags2 = 1;
63.     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {

libavcodec/wmaenc.c:62:5: 
60.     /* extract flag infos */
61.     flags1 = 0;
62.     flags2 = 1;
        ^
63.     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
64.         extradata             = av_malloc(4);

libavcodec/wmaenc.c:63:9: Taking true branch
61.     flags1 = 0;
62.     flags2 = 1;
63.     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
            ^
64.         extradata             = av_malloc(4);
65.         avctx->extradata_size = 4;

libavcodec/wmaenc.c:64:9: 
62.     flags2 = 1;
63.     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
64.         extradata             = av_malloc(4);
            ^
65.         avctx->extradata_size = 4;
66.         AV_WL16(extradata, flags1);

libavutil/mem.c:62:1: start of procedure av_malloc()
  60.  * linker will do it automatically. */
  61. 
  62. void *av_malloc(size_t size)
      ^
  63. {
  64.     void *ptr = NULL;

libavutil/mem.c:64:5: 
  62. void *av_malloc(size_t size)
  63. {
  64.     void *ptr = NULL;
          ^
  65. #if CONFIG_MEMALIGN_HACK
  66.     long diff;

libavutil/mem.c:70:9: Taking false branch
  68. 
  69.     /* let's disallow possibly ambiguous cases */
  70.     if (size > (INT_MAX - 32) || !size)
              ^
  71.         return NULL;
  72. 

libavutil/mem.c:70:35: Taking false branch
  68. 
  69.     /* let's disallow possibly ambiguous cases */
  70.     if (size > (INT_MAX - 32) || !size)
                                        ^
  71.         return NULL;
  72. 

libavutil/mem.c:81:9: Taking true branch
  79.     ((char *)ptr)[-1] = diff;
  80. #elif HAVE_POSIX_MEMALIGN
  81.     if (posix_memalign(&ptr, 32, size))
              ^
  82.         ptr = NULL;
  83. #elif HAVE_ALIGNED_MALLOC

libavutil/mem.c:82:9: 
  80. #elif HAVE_POSIX_MEMALIGN
  81.     if (posix_memalign(&ptr, 32, size))
  82.         ptr = NULL;
              ^
  83. #elif HAVE_ALIGNED_MALLOC
  84.     ptr = _aligned_malloc(size, 32);

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

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)

libavcodec/wmaenc.c:65:9: 
63.     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
64.         extradata             = av_malloc(4);
65.         avctx->extradata_size = 4;
            ^
66.         AV_WL16(extradata, flags1);
67.         AV_WL16(extradata + 2, flags2);

libavcodec/wmaenc.c:66:9: 
64.         extradata             = av_malloc(4);
65.         avctx->extradata_size = 4;
66.         AV_WL16(extradata, flags1);
            ^
67.         AV_WL16(extradata + 2, flags2);
68.     } else if (avctx->codec->id == AV_CODEC_ID_WMAV2) {
