diff options
author | rcombs <rcombs@rcombs.me> | 2023-03-28 16:29:51 -0400 |
---|---|---|
committer | rcombs <rcombs@rcombs.me> | 2023-03-28 16:46:03 -0400 |
commit | 57271e4a685c51488cd69c2a52190280f012976e (patch) | |
tree | 3650332e27751280eb10af96c533a224c6ef9532 | |
parent | e0835b4878f4f866a540e739683411d72c91f431 (diff) | |
download | ffmpeg-57271e4a685c51488cd69c2a52190280f012976e.tar.gz |
lavf/oggdec: fix demux with unrecognized header packets
Fixes ticket #10289.
Co-authored-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavformat/oggparsevorbis.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 061840c2ed..6fd12560bc 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -311,7 +311,12 @@ static int vorbis_header(AVFormatContext *s, int idx) if (!(pkt_type & 1)) return priv->vp ? 0 : AVERROR_INVALIDDATA; - if (os->psize < 1 || pkt_type > 5) + if (pkt_type > 5) { + av_log(s, AV_LOG_VERBOSE, "Ignoring packet with unknown type %d\n", pkt_type); + return 1; + } + + if (os->psize < 1) return AVERROR_INVALIDDATA; if (priv->packet[pkt_type >> 1]) |