mpeg4: report frame decoding completion at ff_MPV_frame_end().

Message ID 20120316223430.EF0535E0D9@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau March 16, 2012, 10:34 p.m.
Module: libav
Branch: master
Commit: c6ccb96bc955b2087ec71033d99b3dcd5203eaf2

Author:    Ronald S. Bultje <rsbultje@gmail.com>
Committer: Ronald S. Bultje <rsbultje@gmail.com>
Date:      Fri Mar 16 14:16:56 2012 -0700

mpeg4: report frame decoding completion at ff_MPV_frame_end().

Prevents hangs on corrupt input.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

---

 libavcodec/mpegvideo.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 8be596b..a239a6a 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1409,8 +1409,7 @@  void ff_MPV_frame_end(MpegEncContext *s)
     s->avctx->coded_frame = &s->current_picture_ptr->f;
 
     if (s->codec_id != CODEC_ID_H264 && s->current_picture.f.reference) {
-        ff_thread_report_progress(&s->current_picture_ptr->f,
-                                  s->mb_height - 1, 0);
+        ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0);
     }
 }