From: Ronghua Wu Date: Fri, 19 Dec 2014 21:53:19 +0000 (-0800) Subject: exynos_omx: check pointer before use to workaround potential crash. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29a60df69e0caa0800bc7cf848b00b719019bb6c;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git exynos_omx: check pointer before use to workaround potential crash. Bug: 18639414 Change-Id: Ia603736d4c81488cc9772ce0cf7b253f2932a2b4 --- 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));