[x265] [PATCH] deblock: set reference frame to NULL if refIdx < 0. Dereferencing refFrameList when
santhoshini at multicorewareinc.com
santhoshini at multicorewareinc.com
Fri Dec 1 09:03:41 CET 2017
# HG changeset patch
# User Santhoshini Sekar <santhoshini at 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265.patch
Type: text/x-patch
Size: 1726 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20171201/4f078dc4/attachment.bin>
More information about the x265-devel
mailing list