[FFmpeg-cvslog] avcodec/siren: Improve the bits left threshold in decode_envelope()

Michael Niedermayer git at videolan.org
Wed Sep 29 20:53:20 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Sep 29 00:18:53 2021 +0200| [1ad4782d2a17d9fed38c0356f1c9f790973eec01] | committer: Michael Niedermayer

avcodec/siren: Improve the bits left threshold in decode_envelope()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ad4782d2a17d9fed38c0356f1c9f790973eec01
---

 libavcodec/siren.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 6cbb3e3ba7..bdb249144b 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -447,7 +447,7 @@ static int decode_envelope(SirenContext *s, GetBitContext *gb,
         int index = 0;
 
         do {
-            if (get_bits_left(gb) < 4)
+            if (get_bits_left(gb) < 4 + number_of_regions - i + s->checksum_bits)
                 return AVERROR_INVALIDDATA;
             index = differential_decoder_tree[i - 1][index][get_bits1(gb)];
         } while (index > 0);



More information about the ffmpeg-cvslog mailing list