mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
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>
This commit is contained in:
+3
-1
@@ -419,7 +419,8 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
|||||||
if (s->pict_type==AV_PICTURE_TYPE_B) {
|
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){
|
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");
|
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);
|
ff_mpeg4_init_direct_mv(s);
|
||||||
}
|
}
|
||||||
@@ -542,6 +543,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
|
|||||||
else
|
else
|
||||||
mb_count = rv20_decode_picture_header(rv);
|
mb_count = rv20_decode_picture_header(rv);
|
||||||
if (mb_count < 0) {
|
if (mb_count < 0) {
|
||||||
|
if (mb_count != ERROR_SKIP_FRAME)
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
|
av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user