X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggdec.c;h=fd18e99869645094cd9e7b2b80a1c41586d2997c;hb=5333e0dd66c5695fc708bc9d7af4bf8750674b8f;hp=66eb605b2fe404d284135fccf951c1e287ada9d4;hpb=e136579ca358093caa6b0a4941717ae7ef1f90b2;p=ffmpeg diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 66eb605b2fe..fd18e998696 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -727,8 +727,16 @@ static void ogg_validate_keyframe(AVFormatContext *s, int idx, int pstart, int p { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; - if (psize && s->streams[idx]->codec->codec_id == AV_CODEC_ID_THEORA) { - if (!!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 0x40)) { + int invalid = 0; + if (psize) { + switch (s->streams[idx]->codec->codec_id) { + case AV_CODEC_ID_THEORA: + invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 0x40); + break; + case AV_CODEC_ID_VP8: + invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 1); + } + if (invalid) { os->pflags ^= AV_PKT_FLAG_KEY; av_log(s, AV_LOG_WARNING, "Broken file, %skeyframe not correctly marked.\n", (os->pflags & AV_PKT_FLAG_KEY) ? "" : "non-");