From 2e7744a6a265604600f86a85c6961dbf5df9ecdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sun, 6 Jan 2013 04:01:11 +0100 Subject: [PATCH] lavc/subviewerdec: fix potential NULL deref. Fixes CID966647 --- libavcodec/subviewerdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index 7580cbe679..63be4188b9 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -56,7 +56,7 @@ static int subviewer_decode_frame(AVCodecContext *avctx, AVBPrint buf; /* To be removed later */ - if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) { + if (ptr && sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) { av_log(avctx, AV_LOG_ERROR, "AVPacket is not clean (contains timing " "information). You need to upgrade your libavformat or " "sanitize your packet.\n");