1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/m101: Check BPS value

Fixes null pointer dereference
Fixes Ticket5520

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-05-18 17:11:20 +02:00
parent 810a8ba5b6
commit 42ee137a0a

View File

@ -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;
}