cavsdec: Make sure a sequence header has been decoded before decoding pictures
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e90a6846c2
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/cavsdec.c
This commit is contained in:

committed by
Luca Barbato

parent
e47543eda5
commit
9f883e75e6
@@ -931,6 +931,11 @@ static int decode_pic(AVSContext *h)
|
||||
int skip_count = -1;
|
||||
enum cavs_mb mb_type;
|
||||
|
||||
if (!h->top_qp) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
skip_bits(&h->gb, 16);//bbv_dwlay
|
||||
if (h->stc == PIC_PB_START_CODE) {
|
||||
h->cur.f->pict_type = get_bits(&h->gb, 2) + AV_PICTURE_TYPE_I;
|
||||
|
Reference in New Issue
Block a user