X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggdec.c;h=a456c3df60234656ef23fde54295bb9fac52d859;hb=337f777f378cfcc0d6f0d01fb7125905e8b0da55;hp=9eb45499c6226028085c096ffd224aa4440b9243;hpb=8edfd0598d17a828cd59873351645ad1fbe8ff16;p=ffmpeg diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 9eb45499c62..a456c3df602 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -226,9 +226,10 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial, char *magic, return AVERROR_INVALIDDATA; } - /* We only have a single stream anyway, so if there's a new stream with - * a different codec just replace it */ os = &ogg->streams[0]; + if (os->codec != codec) + return AVERROR(EINVAL); + os->serial = serial; os->codec = codec; os->serial = serial;