diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-06 06:10:18 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-06 07:06:45 +0400 |
commit | bb01be80462adcf4900c925e25bc644e512a4b7b (patch) | |
tree | a2c03ad5b4788f2f2a1bc839013b9dfa4289430b /libavcodec/rv10.c | |
parent | 7bab631f7df55b361368296f125b95a1814bc18c (diff) |
rv20: Fix handling of frame skip.
Fixes division by zero
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r-- | libavcodec/rv10.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 1528780a37..3f338f3ff3 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -419,7 +419,8 @@ static int rv20_decode_picture_header(RVDecContext *rv) 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; +#define ERROR_SKIP_FRAME -123 + return ERROR_SKIP_FRAME; } ff_mpeg4_init_direct_mv(s); } @@ -542,7 +543,8 @@ static int rv10_decode_packet(AVCodecContext *avctx, else mb_count = rv20_decode_picture_header(rv); if (mb_count < 0) { - av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n"); + if (mb_count != ERROR_SKIP_FRAME) + av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n"); return -1; } |