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

libavformat/oggparsespeex.c:33:1: start of procedure speex_header()
31. #include "oggdec.h"
32. 
33. static int speex_header(AVFormatContext *s, int idx) {
    ^
34.     struct ogg *ogg = s->priv_data;
35.     struct ogg_stream *os = ogg->streams + idx;

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

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

libavformat/oggparsespeex.c:36:5: 
34.     struct ogg *ogg = s->priv_data;
35.     struct ogg_stream *os = ogg->streams + idx;
36.     AVStream *st = s->streams[idx];
        ^
37.     uint8_t *p = os->buf + os->pstart;
38. 

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

libavformat/oggparsespeex.c:39:9: Taking false branch
37.     uint8_t *p = os->buf + os->pstart;
38. 
39.     if (os->seq > 1)
            ^
40.         return 0;
41. 

libavformat/oggparsespeex.c:42:9: Taking true branch
40.         return 0;
41. 
42.     if (os->seq == 0) {
            ^
43.         st->codec->codec_type = CODEC_TYPE_AUDIO;
44.         st->codec->codec_id = CODEC_ID_SPEEX;

libavformat/oggparsespeex.c:43:9: 
41. 
42.     if (os->seq == 0) {
43.         st->codec->codec_type = CODEC_TYPE_AUDIO;
            ^
44.         st->codec->codec_id = CODEC_ID_SPEEX;
45. 

libavformat/oggparsespeex.c:44:9: 
42.     if (os->seq == 0) {
43.         st->codec->codec_type = CODEC_TYPE_AUDIO;
44.         st->codec->codec_id = CODEC_ID_SPEEX;
            ^
45. 
46.         st->codec->sample_rate = AV_RL32(p + 36);

libavformat/oggparsespeex.c:46:9: 
44.         st->codec->codec_id = CODEC_ID_SPEEX;
45. 
46.         st->codec->sample_rate = AV_RL32(p + 36);
            ^
47.         st->codec->channels = AV_RL32(p + 48);
48.         st->codec->frame_size = AV_RL32(p + 56);

libavformat/oggparsespeex.c:47:9: 
45. 
46.         st->codec->sample_rate = AV_RL32(p + 36);
47.         st->codec->channels = AV_RL32(p + 48);
            ^
48.         st->codec->frame_size = AV_RL32(p + 56);
49.         st->codec->extradata_size = os->psize;

libavformat/oggparsespeex.c:48:9: 
46.         st->codec->sample_rate = AV_RL32(p + 36);
47.         st->codec->channels = AV_RL32(p + 48);
48.         st->codec->frame_size = AV_RL32(p + 56);
            ^
49.         st->codec->extradata_size = os->psize;
50.         st->codec->extradata = av_malloc(st->codec->extradata_size

libavformat/oggparsespeex.c:49:9: 
47.         st->codec->channels = AV_RL32(p + 48);
48.         st->codec->frame_size = AV_RL32(p + 56);
49.         st->codec->extradata_size = os->psize;
            ^
50.         st->codec->extradata = av_malloc(st->codec->extradata_size
51.                                          + FF_INPUT_BUFFER_PADDING_SIZE);

libavformat/oggparsespeex.c:50:9: 
48.         st->codec->frame_size = AV_RL32(p + 56);
49.         st->codec->extradata_size = os->psize;
50.         st->codec->extradata = av_malloc(st->codec->extradata_size
            ^
51.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
52.         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:52:9: 
50.         st->codec->extradata = av_malloc(st->codec->extradata_size
51.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
52.         memcpy(st->codec->extradata, p, st->codec->extradata_size);
            ^
53. 
54.         st->time_base.num = 1;
