[FFmpeg-cvslog] avcodec/m101: Check BPS value

Michael Niedermayer git at videolan.org
Wed May 18 18:51:38 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed May 18 17:11:20 2016 +0200| [42ee137a0a7d025f77964e38b438d00095e6dd11] | committer: Michael Niedermayer

avcodec/m101: Check BPS value

Fixes null pointer dereference
Fixes Ticket5520

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42ee137a0a7d025f77964e38b438d00095e6dd11
---

 libavcodec/m101.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/m101.c b/libavcodec/m101.c
index f005670..05546fc 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;
 }



More information about the ffmpeg-cvslog mailing list