diff --git a/modules/stream_filter/skiptags.c b/modules/stream_filter/skiptags.c index 025d78f5df..b1869c8633 100644 --- a/modules/stream_filter/skiptags.c +++ b/modules/stream_filter/skiptags.c @@ -98,15 +98,18 @@ static uint_fast32_t SkipAPETag(stream_t *s) uint_fast32_t size = GetDWLE(peek + 12); - uint_fast32_t flags = GetDWLE(peek + 16); - if ((flags & (1u << 29)) == 0) - return 0; - - if (flags & (1u << 30)) + if (version >= 2000) { - if (size > UINT32_MAX - 32u) - return 0; /* impossibly long tag */ - size += 32; + uint_fast32_t flags = GetDWLE(peek + 16); + if ((flags & (1u << 29)) == 0) + return 0; + + if (flags & (1u << 30)) + { + if (size > UINT32_MAX - 32u) + return 0; /* impossibly long tag */ + size += 32; + } } msg_Dbg(s, "AP2 v%"PRIuFAST32" tag found, "