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

libavcodec/wmaenc.c:30:1: start of procedure encode_init()
28. 
29. 
30. static int encode_init(AVCodecContext * avctx){
    ^
31.     WMACodecContext *s = avctx->priv_data;
32.     int i, flags1, flags2;

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

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

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

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

libavcodec/wmaenc.c:49:8: Taking false branch
47.     }
48. 
49.     if(avctx->bit_rate < 24*1000) {
           ^
50.         av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %i, need 24000 or higher\n",
51.                avctx->bit_rate);

libavcodec/wmaenc.c:56:5: 
54. 
55.     /* extract flag infos */
56.     flags1 = 0;
        ^
57.     flags2 = 1;
58.     if (avctx->codec->id == CODEC_ID_WMAV1) {

libavcodec/wmaenc.c:57:5: 
55.     /* extract flag infos */
56.     flags1 = 0;
57.     flags2 = 1;
        ^
58.     if (avctx->codec->id == CODEC_ID_WMAV1) {
59.         extradata= av_malloc(4);

libavcodec/wmaenc.c:58:9: Taking true branch
56.     flags1 = 0;
57.     flags2 = 1;
58.     if (avctx->codec->id == CODEC_ID_WMAV1) {
            ^
59.         extradata= av_malloc(4);
60.         avctx->extradata_size= 4;

libavcodec/wmaenc.c:59:9: 
57.     flags2 = 1;
58.     if (avctx->codec->id == CODEC_ID_WMAV1) {
59.         extradata= av_malloc(4);
            ^
60.         avctx->extradata_size= 4;
61.         AV_WL16(extradata, flags1);

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 false branch
  72. 
  73.     /* let's disallow possible ambiguous cases */
  74.     if (size > (INT_MAX-32) || !size)
              ^
  75.         return NULL;
  76. 

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

libavutil/mem.c:85:9: Taking true branch
  83.     ((char*)ptr)[-1]= diff;
  84. #elif HAVE_POSIX_MEMALIGN
  85.     if (posix_memalign(&ptr,32,size))
              ^
  86.         ptr = NULL;
  87. #elif HAVE_MEMALIGN

libavutil/mem.c:86:9: 
  84. #elif HAVE_POSIX_MEMALIGN
  85.     if (posix_memalign(&ptr,32,size))
  86.         ptr = NULL;
              ^
  87. #elif HAVE_MEMALIGN
  88.     ptr = memalign(32,size);

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

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)

libavcodec/wmaenc.c:60:9: 
58.     if (avctx->codec->id == CODEC_ID_WMAV1) {
59.         extradata= av_malloc(4);
60.         avctx->extradata_size= 4;
            ^
61.         AV_WL16(extradata, flags1);
62.         AV_WL16(extradata+2, flags2);

libavcodec/wmaenc.c:61:9: 
59.         extradata= av_malloc(4);
60.         avctx->extradata_size= 4;
61.         AV_WL16(extradata, flags1);
            ^
62.         AV_WL16(extradata+2, flags2);
63.     } else if (avctx->codec->id == CODEC_ID_WMAV2) {
