From d4e28917afb82548fe830448033068c080cafd02 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 21 Aug 2025 18:40:26 +0200 Subject: [PATCH] avcodec/sanm: Replace impossible bitstream check by assert the space left and size have already been cross checked by the caller Signed-off-by: Michael Niedermayer --- libavcodec/sanm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 4cf1ac5221..28fdcb3659 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1832,8 +1832,7 @@ static int process_ftch(SANMVideoContext *ctx, int size) xoff = bytestream2_get_le16u(&ctx->gb); yoff = bytestream2_get_le16u(&ctx->gb); } else { - if (bytestream2_get_bytes_left(&ctx->gb) < 12) - return AVERROR_INVALIDDATA; + av_assert0(bytestream2_get_bytes_left(&ctx->gb) >= 12); bytestream2_skip(&ctx->gb, 4); xoff = bytestream2_get_be32u(&ctx->gb); yoff = bytestream2_get_be32u(&ctx->gb);