From 29a60df69e0caa0800bc7cf848b00b719019bb6c Mon Sep 17 00:00:00 2001 From: Ronghua Wu Date: Fri, 19 Dec 2014 13:53:19 -0800 Subject: [PATCH] exynos_omx: check pointer before use to workaround potential crash. Bug: 18639414 Change-Id: Ia603736d4c81488cc9772ce0cf7b253f2932a2b4 --- .../video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c index a456a2b..48e152f 100644 --- a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c +++ b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c @@ -1483,7 +1483,9 @@ static ExynosVideoErrorType MFC_Decoder_Enqueue_Inbuf( buf.m.planes[i].bytesused = dataSize[i]; } - if ((((OMX_BUFFERHEADERTYPE *)pPrivate)->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { + // FIXME: figure out why |pPrivate| may be NULL. + if (pPrivate && + (((OMX_BUFFERHEADERTYPE *)pPrivate)->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { buf.flags |= V4L2_BUF_FLAG_LAST_FRAME; ALOGV("%s: OMX_BUFFERFLAG_EOS => LAST_FRAME: 0x%x", __func__, !!(buf.flags & V4L2_BUF_FLAG_LAST_FRAME)); -- 2.20.1