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

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

libavformat/oggparsespeex.c:41:5: 
39. 
40. static int speex_header(AVFormatContext *s, int idx) {
41.     struct ogg *ogg = s->priv_data;
        ^
42.     struct ogg_stream *os = ogg->streams + idx;
43.     struct speex_params *spxp = os->private;

libavformat/oggparsespeex.c:42:5: 
40. static int speex_header(AVFormatContext *s, int idx) {
41.     struct ogg *ogg = s->priv_data;
42.     struct ogg_stream *os = ogg->streams + idx;
        ^
43.     struct speex_params *spxp = os->private;
44.     AVStream *st = s->streams[idx];

libavformat/oggparsespeex.c:43:5: 
41.     struct ogg *ogg = s->priv_data;
42.     struct ogg_stream *os = ogg->streams + idx;
43.     struct speex_params *spxp = os->private;
        ^
44.     AVStream *st = s->streams[idx];
45.     uint8_t *p = os->buf + os->pstart;

libavformat/oggparsespeex.c:44:5: 
42.     struct ogg_stream *os = ogg->streams + idx;
43.     struct speex_params *spxp = os->private;
44.     AVStream *st = s->streams[idx];
        ^
45.     uint8_t *p = os->buf + os->pstart;
46. 

libavformat/oggparsespeex.c:45:5: 
43.     struct speex_params *spxp = os->private;
44.     AVStream *st = s->streams[idx];
45.     uint8_t *p = os->buf + os->pstart;
        ^
46. 
47.     if (!spxp) {

libavformat/oggparsespeex.c:47:10: Taking false branch
45.     uint8_t *p = os->buf + os->pstart;
46. 
47.     if (!spxp) {
             ^
48.         spxp = av_mallocz(sizeof(*spxp));
49.         os->private = spxp;

libavformat/oggparsespeex.c:52:9: Taking false branch
50.     }
51. 
52.     if (spxp->seq > 1)
            ^
53.         return 0;
54. 

libavformat/oggparsespeex.c:55:9: Taking true branch
53.         return 0;
54. 
55.     if (spxp->seq == 0) {
            ^
56.         int frames_per_packet;
57.         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

libavformat/oggparsespeex.c:57:9: 
55.     if (spxp->seq == 0) {
56.         int frames_per_packet;
57.         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
            ^
58.         st->codec->codec_id = CODEC_ID_SPEEX;
59. 

libavformat/oggparsespeex.c:58:9: 
56.         int frames_per_packet;
57.         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
58.         st->codec->codec_id = CODEC_ID_SPEEX;
            ^
59. 
60.         st->codec->sample_rate = AV_RL32(p + 36);

libavformat/oggparsespeex.c:60:9: 
58.         st->codec->codec_id = CODEC_ID_SPEEX;
59. 
60.         st->codec->sample_rate = AV_RL32(p + 36);
            ^
61.         st->codec->channels = AV_RL32(p + 48);
62. 

libavformat/oggparsespeex.c:61:9: 
59. 
60.         st->codec->sample_rate = AV_RL32(p + 36);
61.         st->codec->channels = AV_RL32(p + 48);
            ^
62. 
63.         spxp->packet_size  = AV_RL32(p + 56);

libavformat/oggparsespeex.c:63:9: 
61.         st->codec->channels = AV_RL32(p + 48);
62. 
63.         spxp->packet_size  = AV_RL32(p + 56);
            ^
64.         frames_per_packet  = AV_RL32(p + 64);
65.         if (frames_per_packet)

libavformat/oggparsespeex.c:64:9: 
62. 
63.         spxp->packet_size  = AV_RL32(p + 56);
64.         frames_per_packet  = AV_RL32(p + 64);
            ^
65.         if (frames_per_packet)
66.             spxp->packet_size *= frames_per_packet;

libavformat/oggparsespeex.c:65:13: Taking true branch
63.         spxp->packet_size  = AV_RL32(p + 56);
64.         frames_per_packet  = AV_RL32(p + 64);
65.         if (frames_per_packet)
                ^
66.             spxp->packet_size *= frames_per_packet;
67. 

libavformat/oggparsespeex.c:66:13: 
64.         frames_per_packet  = AV_RL32(p + 64);
65.         if (frames_per_packet)
66.             spxp->packet_size *= frames_per_packet;
                ^
67. 
68.         st->codec->extradata_size = os->psize;

libavformat/oggparsespeex.c:68:9: 
66.             spxp->packet_size *= frames_per_packet;
67. 
68.         st->codec->extradata_size = os->psize;
            ^
69.         st->codec->extradata = av_malloc(st->codec->extradata_size
70.                                          + FF_INPUT_BUFFER_PADDING_SIZE);

libavformat/oggparsespeex.c:69:9: 
67. 
68.         st->codec->extradata_size = os->psize;
69.         st->codec->extradata = av_malloc(st->codec->extradata_size
            ^
70.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
71.         memcpy(st->codec->extradata, p, st->codec->extradata_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:72:9: Taking true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
  73.         return NULL;
              ^
  74. 
  75. #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)

libavformat/oggparsespeex.c:71:9: 
69.         st->codec->extradata = av_malloc(st->codec->extradata_size
70.                                          + FF_INPUT_BUFFER_PADDING_SIZE);
71.         memcpy(st->codec->extradata, p, st->codec->extradata_size);
            ^
72. 
73.         avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
