libavformat/oggparsespeex.c:66: error: Null Dereference
  pointer `st->codec->extradata` last assigned on line 64 could be null and is dereferenced by call to `memcpy()` at line 66, column 9.

libavformat/oggparsespeex.c:37:1: start of procedure speex_header()
35. };
36. 
37. static int speex_header(AVFormatContext *s, int idx) {
    ^
38.     struct ogg *ogg = s->priv_data;
39.     struct ogg_stream *os = ogg->streams + idx;

libavformat/oggparsespeex.c:38:5: 
36. 
37. static int speex_header(AVFormatContext *s, int idx) {
38.     struct ogg *ogg = s->priv_data;
        ^
39.     struct ogg_stream *os = ogg->streams + idx;
40.     AVStream *st = s->streams[idx];

libavformat/oggparsespeex.c:39:5: 
37. static int speex_header(AVFormatContext *s, int idx) {
38.     struct ogg *ogg = s->priv_data;
39.     struct ogg_stream *os = ogg->streams + idx;
        ^
40.     AVStream *st = s->streams[idx];
41.     uint8_t *p = os->buf + os->pstart;

libavformat/oggparsespeex.c:40:5: 
38.     struct ogg *ogg = s->priv_data;
39.     struct ogg_stream *os = ogg->streams + idx;
40.     AVStream *st = s->streams[idx];
        ^
41.     uint8_t *p = os->buf + os->pstart;
42. 

libavformat/oggparsespeex.c:41:5: 
39.     struct ogg_stream *os = ogg->streams + idx;
40.     AVStream *st = s->streams[idx];
41.     uint8_t *p = os->buf + os->pstart;
        ^
42. 
43.     if (os->seq > 1)

libavformat/oggparsespeex.c:43:9: Taking false branch
41.     uint8_t *p = os->buf + os->pstart;
42. 
43.     if (os->seq > 1)
            ^
44.         return 0;
45. 

libavformat/oggparsespeex.c:46:9: Taking true branch
44.         return 0;
45. 
46.     if (os->seq == 0) {
            ^
47.         int frames_per_packet;
48.         st->codec->codec_type = CODEC_TYPE_AUDIO;

libavformat/oggparsespeex.c:48:9: 
46.     if (os->seq == 0) {
47.         int frames_per_packet;
48.         st->codec->codec_type = CODEC_TYPE_AUDIO;
            ^
49.         st->codec->codec_id = CODEC_ID_SPEEX;
50. 

libavformat/oggparsespeex.c:49:9: 
47.         int frames_per_packet;
48.         st->codec->codec_type = CODEC_TYPE_AUDIO;
49.         st->codec->codec_id = CODEC_ID_SPEEX;
            ^
50. 
51.         st->codec->sample_rate = AV_RL32(p + 36);

libavformat/oggparsespeex.c:51:9: 
49.         st->codec->codec_id = CODEC_ID_SPEEX;
50. 
51.         st->codec->sample_rate = AV_RL32(p + 36);
            ^
52.         st->codec->channels = AV_RL32(p + 48);
53. 

libavformat/oggparsespeex.c:52:9: 
50. 
51.         st->codec->sample_rate = AV_RL32(p + 36);
52.         st->codec->channels = AV_RL32(p + 48);
            ^
53. 
54.         /* We treat the whole Speex packet as a single frame everywhere Speex

libavformat/oggparsespeex.c:58:9: 
56.            and joining individual Speex frames, which are not always
57.            byte-aligned. */
58.         st->codec->frame_size = AV_RL32(p + 56);
            ^
59.         frames_per_packet     = AV_RL32(p + 64);
60.         if (frames_per_packet)

libavformat/oggparsespeex.c:59:9: 
57.            byte-aligned. */
58.         st->codec->frame_size = AV_RL32(p + 56);
59.         frames_per_packet     = AV_RL32(p + 64);
            ^
60.         if (frames_per_packet)
61.             st->codec->frame_size *= frames_per_packet;

libavformat/oggparsespeex.c:60:13: Taking true branch
58.         st->codec->frame_size = AV_RL32(p + 56);
59.         frames_per_packet     = AV_RL32(p + 64);
60.         if (frames_per_packet)
                ^
61.             st->codec->frame_size *= frames_per_packet;
62. 

libavformat/oggparsespeex.c:61:13: 
59.         frames_per_packet     = AV_RL32(p + 64);
60.         if (frames_per_packet)
61.             st->codec->frame_size *= frames_per_packet;
                ^
62. 
63.         st->codec->extradata_size = os->psize;

libavformat/oggparsespeex.c:63:9: 
61.             st->codec->frame_size *= frames_per_packet;
62. 
63.         st->codec->extradata_size = os->psize;
            ^
64.         st->codec->extradata = av_malloc(st->codec->extradata_size
65.                                          + FF_INPUT_BUFFER_PADDING_SIZE);

libavformat/oggparsespeex.c:64:9: 
62. 
63.         st->codec->extradata_size = os->psize;
64.         st->codec->extradata = av_malloc(st->codec->extradata_size
            ^
65.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
66.         memcpy(st->codec->extradata, p, st->codec->extradata_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)

libavformat/oggparsespeex.c:66:9: 
64.         st->codec->extradata = av_malloc(st->codec->extradata_size
65.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
66.         memcpy(st->codec->extradata, p, st->codec->extradata_size);
            ^
67. 
68.         st->time_base.num = 1;
