<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CopySubpix reads past the end of input buffer in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166824#M26763</link>
    <description>&lt;PRE class="brush:cpp;"&gt;vector&amp;lt;uint8_t&amp;gt; input{ 10, 20, 100, 200, 10, 20, 100, 200, };
vector&amp;lt;uint8_t&amp;gt; output(2 * 4);
ippiCopySubpix_8u_C1R(input.data(), 2, output.data(), 2, { 2, 4 }, 0.5, 0);&lt;/PRE&gt;

&lt;P&gt;fails with an exception when running under App Verifier with Heap checking and Protect checking. With these options app verifier inserts a page without read permission after input[8]. I bet valgrind also catches this. You can also tell that ipp is reading after the end of each line because the last pixel of each output line is the average of the last pixel of the input line and the first pixel of the next input line.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 18:19:40 GMT</pubDate>
    <dc:creator>BMart1</dc:creator>
    <dc:date>2017-08-14T18:19:40Z</dc:date>
    <item>
      <title>CopySubpix reads past the end of input buffer</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166824#M26763</link>
      <description>&lt;PRE class="brush:cpp;"&gt;vector&amp;lt;uint8_t&amp;gt; input{ 10, 20, 100, 200, 10, 20, 100, 200, };
vector&amp;lt;uint8_t&amp;gt; output(2 * 4);
ippiCopySubpix_8u_C1R(input.data(), 2, output.data(), 2, { 2, 4 }, 0.5, 0);&lt;/PRE&gt;

&lt;P&gt;fails with an exception when running under App Verifier with Heap checking and Protect checking. With these options app verifier inserts a page without read permission after input[8]. I bet valgrind also catches this. You can also tell that ipp is reading after the end of each line because the last pixel of each output line is the average of the last pixel of the input line and the first pixel of the next input line.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 18:19:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166824#M26763</guid>
      <dc:creator>BMart1</dc:creator>
      <dc:date>2017-08-14T18:19:40Z</dc:date>
    </item>
    <item>
      <title>Hi Bruno,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166825#M26764</link>
      <description>&lt;P&gt;Hi Bruno,&lt;/P&gt;

&lt;P&gt;I'll investigate this and get back to you soon.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 07:02:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166825#M26764</guid>
      <dc:creator>Alice_H_Intel</dc:creator>
      <dc:date>2017-08-15T07:02:09Z</dc:date>
    </item>
    <item>
      <title>It still crashes in ipp 2018.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166826#M26765</link>
      <description>&lt;P&gt;It still crashes in ipp 2018. I've made a simple repro that doesn't need app verifier:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#define _IPP_SEQUENTIAL_STATIC
#include &amp;lt;ippcore.h&amp;gt;
#include &amp;lt;ippvm.h&amp;gt;
#include &amp;lt;ipps.h&amp;gt;
#include &amp;lt;ippi.h&amp;gt;
#include &amp;lt;ippcv.h&amp;gt;
#include &amp;lt;cstdint&amp;gt;
#include &amp;lt;Windows.h&amp;gt;
using namespace std;

int main()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; static uint8_t const input[4][2] = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 10, 20, },
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 100, 200, },
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 10, 20, },
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 100, 200, },
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t output[4][2]{};
&amp;nbsp;&amp;nbsp;&amp;nbsp; ippiCopySubpix_8u_C1R(input[0], 2, output[0], 2, { 2, 4 }, 0.5, 0);

&amp;nbsp;&amp;nbsp;&amp;nbsp; int const pagesize = 4 * 1024;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void* mem = VirtualAlloc(nullptr, 2 * pagesize, MEM_RESERVE, PAGE_READWRITE); // reserve 2 pages
&amp;nbsp;&amp;nbsp;&amp;nbsp; VirtualAlloc(mem, pagesize, MEM_COMMIT, PAGE_READWRITE); // only commit the first, so reading from the second crashes
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t* guarded_input = (uint8_t*)mem + pagesize - sizeof input;
&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(guarded_input, input, sizeof input); // copy input to end of first page
&amp;nbsp;&amp;nbsp;&amp;nbsp; ippiCopySubpix_8u_C1R(guarded_input, 2, output[0], 2, { 2, 4 }, 0.5, 0);
}
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 13:47:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166826#M26765</guid>
      <dc:creator>BMart1</dc:creator>
      <dc:date>2017-10-03T13:47:24Z</dc:date>
    </item>
    <item>
      <title>Maybe this is the correct</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166827#M26766</link>
      <description>&lt;P&gt;Maybe this is the correct behavior and borders need to be considered by hand?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 12:39:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166827#M26766</guid>
      <dc:creator>BMart1</dc:creator>
      <dc:date>2018-01-08T12:39:29Z</dc:date>
    </item>
    <item>
      <title>Bruno,  </title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166828#M26767</link>
      <description>&lt;P&gt;Bruno,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	Thanks for the code.&amp;nbsp; could you submit a support ticket for IPP product at our support portal: https://&lt;SPAN class="fontstyle0"&gt;&lt;A href="https://community.intel.com/www.intel.com/supporttickets" target="_blank"&gt;www.intel.com/supporttickets&lt;/A&gt; ?&lt;/SPAN&gt;&lt;BR style="font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; text-align: -webkit-auto; text-size-adjust: auto;" /&gt;
	so our support engineer can reproduce your test code there, to root the problem.&amp;nbsp;&lt;BR /&gt;
	One document is attached if you want to learn some steps on submitting a ticket.&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	regards,&lt;BR /&gt;
	Chao&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 08:01:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166828#M26767</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2018-01-09T08:01:39Z</dc:date>
    </item>
    <item>
      <title>Just did.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166829#M26768</link>
      <description>&lt;P&gt;Just did.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 10:50:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166829#M26768</guid>
      <dc:creator>BMart1</dc:creator>
      <dc:date>2018-01-09T10:50:13Z</dc:date>
    </item>
    <item>
      <title>Hi Bruno,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166830#M26769</link>
      <description>&lt;P&gt;Hi Bruno,&lt;/P&gt;

&lt;P&gt;you are right - it is IPP ROI concept that is described in the manual - as this function doesn't support border parameter - by default its behavior is as for border "inmem" case:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;for subpixel copying IPP uses linear interpolation, therefore it's customer's responsibility to provide all required pixels beyond provided ROI - in the attached example it means + 1 column to the right and +1 row at the bottom. See used formula below:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;dst&lt;J&gt; = (TYPE)ROUND(a00*src&lt;J&gt; +a10*src[j+1]+ a01*src[j+srcStep]+a11*src[j+srcStep+1]);&lt;/J&gt;&lt;/J&gt;&lt;/P&gt;

&lt;P&gt;regards, Igor.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 14:13:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/CopySubpix-reads-past-the-end-of-input-buffer/m-p/1166830#M26769</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2018-03-02T14:13:34Z</dc:date>
    </item>
  </channel>
</rss>

