[FFmpeg-cvslog] avcodec/mpc8: check for overread earlier and abort decoding frame

Paul B Mahol git at videolan.org
Fri Mar 30 14:01:41 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Mar 30 12:32:00 2018 +0200| [cc402282551d493829455fd097890cc6e2bc556a] | committer: Paul B Mahol

avcodec/mpc8: check for overread earlier and abort decoding frame

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/mpc8.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 355a9d2f3f..6347e1f691 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -273,6 +273,11 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
         if(maxband > 32) maxband -= 33;
     }
 
+    if (get_bits_left(gb) < 0) {
+        *got_frame_ptr = 0;
+        return buf_size;
+    }
+
     if(maxband > c->maxbands + 1) {
         av_log(avctx, AV_LOG_ERROR, "maxband %d too large\n",maxband);
         return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list