Commit 23a1f0c5 authored by Kostya Shishkov's avatar Kostya Shishkov Committed by Anton Khirnov

rv34: check that subsequent slices have the same type as first one.

This prevents some crashes when corrupted bitstream reports e.g. P-type
slice in I-frame. Official RealVideo decoder demands all slices to be
of the same type too.
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 47a8589f
......@@ -1336,6 +1336,13 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
}
}
s->mb_x = s->mb_y = 0;
} else {
int slice_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I;
if (slice_type != s->pict_type) {
av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
return AVERROR_INVALIDDATA;
}
}
r->si.end = end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment