Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-18 18:11:20 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-18 19:40:22 +0300
commit42ee137a0a7d025f77964e38b438d00095e6dd11 (patch)
tree94d6ce0010528bed6ffb0d6bcf9e9eb95f04b094 /libavcodec/m101.c
parent810a8ba5b67389e808ed2f124e1cd54b8a26e679 (diff)
avcodec/m101: Check BPS value
Fixes null pointer dereference Fixes Ticket5520 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/m101.c')
-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;
}