Commit 7205e896 authored by Michael Niedermayer's avatar Michael Niedermayer

dxa: check reference frame availability before use.

Fix NULL pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent daede25f
...@@ -270,6 +270,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -270,6 +270,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
case 13: case 13:
c->pic.key_frame = 0; c->pic.key_frame = 0;
c->pic.pict_type = AV_PICTURE_TYPE_P; c->pic.pict_type = AV_PICTURE_TYPE_P;
if (!c->prev.data[0]) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame\n");
return AVERROR_INVALIDDATA;
}
decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]); decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]);
break; break;
default: default:
......
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