Revision 403fa3cf libavformat/oggparsevorbis.c

View differences:

libavformat/oggparsevorbis.c
256 256
            st->time_base.den = srate;
257 257
        }
258 258
    } else if (os->buf[os->pstart] == 3) {
259
        if (os->psize > 8)
260
            ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);
259
        if (os->psize > 8 &&
260
            ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8) >= 0) {
261
            // drop all metadata we parsed and which is not required by libvorbis
262
            unsigned new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
263
            if (new_len >= 16 && new_len < os->psize) {
264
                AV_WL32(priv->packet[1] + new_len - 5, 0);
265
                priv->packet[1][new_len - 1] = 1;
266
                priv->len[1] = new_len;
267
            }
268
        }
261 269
    } else {
262 270
        st->codec->extradata_size =
263 271
            fixup_vorbis_headers(s, priv, &st->codec->extradata);

Also available in: Unified diff