1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

error concealment: check that references are frames and not fields.

frames cant have field references.
Fixes a deadlock

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-18 22:51:54 +01:00
parent 8a03a60b4a
commit e8fed4d331

View File

@ -66,6 +66,10 @@ static void decode_mb(MpegEncContext *s, int ref)
av_log(s->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n"); av_log(s->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n");
ref = 0; ref = 0;
} }
if ((h->ref_list[0][ref].f.reference&3) != 3) {
av_log(s->avctx, AV_LOG_DEBUG, "Reference invalid\n");
return;
}
fill_rectangle(&s->current_picture.f.ref_index[0][4 * h->mb_xy], fill_rectangle(&s->current_picture.f.ref_index[0][4 * h->mb_xy],
2, 2, 2, ref, 1); 2, 2, 2, ref, 1);
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);