[FFmpeg-cvslog] avcodec/diracdec: check that GetBitContext has not ended in codeblock()

Michael Niedermayer git at videolan.org
Fri Sep 28 03:16:32 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Sep 14 00:22:13 2018 +0200| [179ed2d2e08949662de2249c71f01ae388ca851e] | committer: Michael Niedermayer

avcodec/diracdec: check that GetBitContext has not ended in codeblock()

Fixes: Timeout (part 2 of 2)
Fixes: 9774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5748957085958144

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

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

 libavcodec/diracdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index cbd7fd1532..af561d1426 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -548,6 +548,8 @@ static inline int codeblock(DiracContext *s, SubBand *b,
         }
     } else {
         for (y = top; y < bottom; y++) {
+            if (get_bits_left(gb) < 1)
+                return AVERROR_INVALIDDATA;
             for (x = left; x < right; x++) {
                 int val = coeff_unpack_golomb(gb, qfactor, qoffset);
                 if (b->pshift) {



More information about the ffmpeg-cvslog mailing list