[FFmpeg-cvslog] rv10: always check direct mode interpolation times.

Michael Niedermayer git at videolan.org
Mon Jan 7 21:42:38 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan  7 21:16:23 2013 +0100| [f65daf577af25df69f3b43a49879158d2f77f3f8] | committer: Michael Niedermayer

rv10: always check direct mode interpolation times.

Fixes Division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/rv10.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index e10cbbf..2334fd1 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -415,13 +415,15 @@ static int rv20_decode_picture_header(RVDecContext *rv)
         }else{
             s->time= seq;
             s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
-            if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){
-                av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible from seeking? skipping current b frame\n");
-                return FRAME_SKIPPED;
-            }
-            ff_mpeg4_init_direct_mv(s);
         }
     }
+    if (s->pict_type==AV_PICTURE_TYPE_B) {
+        if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){
+            av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible from seeking? skipping current b frame\n");
+            return FRAME_SKIPPED;
+        }
+        ff_mpeg4_init_direct_mv(s);
+    }
 
     s->no_rounding= get_bits1(&s->gb);
 



More information about the ffmpeg-cvslog mailing list