Commit 42ee137a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/m101: Check BPS value

Fixes null pointer dereference
Fixes Ticket5520
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 810a8ba5
......@@ -31,9 +31,12 @@ static av_cold int m101_decode_init(AVCodecContext *avctx)
if (avctx->extradata[2*4] == 10)
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
else
else if (avctx->extradata[2*4] == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUYV422;
} else {
avpriv_request_sample(avctx, "BPS %d\n", avctx->extradata[2*4]);
return AVERROR_INVALIDDATA;
}
return 0;
}
......
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