[FFmpeg-cvslog] avcodec/wavarc: check that nb_samples is valid

Paul B Mahol git at videolan.org
Mon Feb 6 17:38:04 EET 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Feb  6 16:32:38 2023 +0100| [d7c2da1f8d14672ff0768305b87cf118ad320469] | committer: Paul B Mahol

avcodec/wavarc: check that nb_samples is valid

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

 libavcodec/wavarc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c
index 898c3c2055..caab08cb24 100644
--- a/libavcodec/wavarc.c
+++ b/libavcodec/wavarc.c
@@ -258,6 +258,10 @@ static int decode_2slp(AVCodecContext *avctx,
             return AVERROR_EOF;
         case 8:
             s->nb_samples = get_urice(gb, 8);
+            if (s->nb_samples > 570) {
+                s->nb_samples = 570;
+                return AVERROR_INVALIDDATA;
+            }
             continue;
         case 7:
             s->shift = get_urice(gb, 2);



More information about the ffmpeg-cvslog mailing list