<?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 Re: Intel IPP 5.3 JPEG Parse Bug and Fixed Code in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-5-3-JPEG-Parse-Bug-and-Fixed-Code/m-p/911259#M14287</link>
    <description>&lt;P&gt;Hi John,&lt;/P&gt;
&lt;P&gt;That might work in your case, but I would recommend to the following fix for that issue:&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;1. seek up to requested position 'pos' with Seek method. If that fail - most probably requested position is outside of file or JPEG memory buffer.&lt;/P&gt;
&lt;P&gt;2. Call FillBuffer method, to obtain missed data&lt;/P&gt;
&lt;P&gt;3. return byte at postion 0 (which now is desired 'pos')&lt;/P&gt;
&lt;P&gt;That will give you opportunity to check bytes on long distances.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2008 10:27:58 GMT</pubDate>
    <dc:creator>Vladimir_Dudnik</dc:creator>
    <dc:date>2008-03-31T10:27:58Z</dc:date>
    <item>
      <title>Intel IPP 5.3 JPEG Parse Bug and Fixed Code</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-5-3-JPEG-Parse-Bug-and-Fixed-Code/m-p/911258#M14286</link>
      <description>&lt;FONT size="2"&gt;
&lt;P&gt;CBitStreamInput::CheckByte(...) should fill the buffer when it exceeds the buffer length, and then only return an error if there still is not space.&lt;/P&gt;
&lt;P&gt;Otherwise, you will get incorrect parse failures on boundary conditions when parsing an APP14 and possibly other blocks.&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;
&lt;P&gt;Here's the full, fixed function we implemented:&lt;/P&gt;&lt;/FONT&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;&lt;P&gt;JERRCODE CBitStreamInput::CheckByte(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; pos, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt;* byte)&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;if&lt;/FONT&gt;&lt;FONT size="2"&gt;(m_currPos + pos &amp;gt;= m_DataLen)&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;  JERRCODE jerr = FillBuffer();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;  if&lt;/FONT&gt;&lt;FONT size="2"&gt;(JPEG_OK != jerr)&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;    return&lt;/FONT&gt;&lt;FONT size="2"&gt; jerr;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;  if&lt;/FONT&gt;&lt;FONT size="2"&gt;(m_currPos + pos &amp;gt;= m_DataLen)&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;    return&lt;/FONT&gt;&lt;FONT size="2"&gt; JPEG_ERR_INTERNAL;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;*byte = m_pData[m_currPos + pos];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;return&lt;/FONT&gt;&lt;FONT size="2"&gt; JPEG_OK;&lt;P&gt;&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;// CBitStreamInput::CheckByte()&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Mar 2008 15:00:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-5-3-JPEG-Parse-Bug-and-Fixed-Code/m-p/911258#M14286</guid>
      <dc:creator>johnt</dc:creator>
      <dc:date>2008-03-25T15:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Intel IPP 5.3 JPEG Parse Bug and Fixed Code</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-5-3-JPEG-Parse-Bug-and-Fixed-Code/m-p/911259#M14287</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;
&lt;P&gt;That might work in your case, but I would recommend to the following fix for that issue:&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;1. seek up to requested position 'pos' with Seek method. If that fail - most probably requested position is outside of file or JPEG memory buffer.&lt;/P&gt;
&lt;P&gt;2. Call FillBuffer method, to obtain missed data&lt;/P&gt;
&lt;P&gt;3. return byte at postion 0 (which now is desired 'pos')&lt;/P&gt;
&lt;P&gt;That will give you opportunity to check bytes on long distances.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2008 10:27:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-5-3-JPEG-Parse-Bug-and-Fixed-Code/m-p/911259#M14287</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-03-31T10:27:58Z</dc:date>
    </item>
  </channel>
</rss>

