aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-18 17:11:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-18 18:40:22 +0200
commit42ee137a0a7d025f77964e38b438d00095e6dd11 (patch)
tree94d6ce0010528bed6ffb0d6bcf9e9eb95f04b094
parent810a8ba5b67389e808ed2f124e1cd54b8a26e679 (diff)
downloadffmpeg-42ee137a0a7d025f77964e38b438d00095e6dd11.tar.gz
avcodec/m101: Check BPS value
Fixes null pointer dereference Fixes Ticket5520 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/m101.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/m101.c b/libavcodec/m101.c
index f005670ed1..05546fcbe2 100644
--- a/libavcodec/m101.c
+++ b/libavcodec/m101.c
@@ -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;
}