# HG changeset patch # User Santhoshini Sekar <santhosh...@multicorewareinc.com> # Date 1512043592 -19800 # Thu Nov 30 17:36:32 2017 +0530 # Branch stable # Node ID f9d08feabf7b2607561d337e5048657a786a7c68 # Parent b0d89eaaebcf3534204e054243d402b6cf646234 deblock: set reference frame to NULL if refIdx < 0. Dereferencing refFrameList when refIdx < 0 is not valid
diff --git a/source/common/deblock.cpp b/source/common/deblock.cpp --- a/source/common/deblock.cpp +++ b/source/common/deblock.cpp @@ -208,8 +208,8 @@ const Slice* const sliceQ = cuQ->m_slice; const Slice* const sliceP = cuP->m_slice; - const Frame* refP0 = sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]]; - const Frame* refQ0 = sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]]; + const Frame* refP0 = (cuP->m_refIdx[0][partP] >= 0) ? sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]] : NULL; + const Frame* refQ0 = (cuQ->m_refIdx[0][partQ] >= 0) ? sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]] : NULL; const MV& mvP0 = refP0 ? cuP->m_mv[0][partP] : zeroMv; const MV& mvQ0 = refQ0 ? cuQ->m_mv[0][partQ] : zeroMv; @@ -220,8 +220,8 @@ } // (sliceQ->isInterB() || sliceP->isInterB()) - const Frame* refP1 = sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]]; - const Frame* refQ1 = sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]]; + const Frame* refP1 = (cuP->m_refIdx[1][partP] >= 0) ? sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]] : NULL; + const Frame* refQ1 = (cuQ->m_refIdx[1][partQ] >= 0) ? sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]] : NULL; const MV& mvP1 = refP1 ? cuP->m_mv[1][partP] : zeroMv; const MV& mvQ1 = refQ1 ? cuQ->m_mv[1][partQ] : zeroMv;
# HG changeset patch # User Santhoshini Sekar <santhosh...@multicorewareinc.com> # Date 1512043592 -19800 # Thu Nov 30 17:36:32 2017 +0530 # Branch stable # Node ID f9d08feabf7b2607561d337e5048657a786a7c68 # Parent b0d89eaaebcf3534204e054243d402b6cf646234 deblock: set reference frame to NULL if refIdx < 0. Dereferencing refFrameList when refIdx < 0 is not valid diff --git a/source/common/deblock.cpp b/source/common/deblock.cpp --- a/source/common/deblock.cpp +++ b/source/common/deblock.cpp @@ -208,8 +208,8 @@ const Slice* const sliceQ = cuQ->m_slice; const Slice* const sliceP = cuP->m_slice; - const Frame* refP0 = sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]]; - const Frame* refQ0 = sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]]; + const Frame* refP0 = (cuP->m_refIdx[0][partP] >= 0) ? sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]] : NULL; + const Frame* refQ0 = (cuQ->m_refIdx[0][partQ] >= 0) ? sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]] : NULL; const MV& mvP0 = refP0 ? cuP->m_mv[0][partP] : zeroMv; const MV& mvQ0 = refQ0 ? cuQ->m_mv[0][partQ] : zeroMv; @@ -220,8 +220,8 @@ } // (sliceQ->isInterB() || sliceP->isInterB()) - const Frame* refP1 = sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]]; - const Frame* refQ1 = sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]]; + const Frame* refP1 = (cuP->m_refIdx[1][partP] >= 0) ? sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]] : NULL; + const Frame* refQ1 = (cuQ->m_refIdx[1][partQ] >= 0) ? sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]] : NULL; const MV& mvP1 = refP1 ? cuP->m_mv[1][partP] : zeroMv; const MV& mvQ1 = refQ1 ? cuQ->m_mv[1][partQ] : zeroMv;
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel