<?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 H.264 Decoder (IPP Sample): decoder crashes when invalid prefix in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800352#M3169</link>
    <description>Can you upload this stream? It will be useful for reproducing and testing purposes.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;Can somebody fix the incorrectly spelled "lenght"found inthe source code?&lt;/DIV&gt;&lt;DIV&gt;Done )&lt;/DIV&gt;</description>
    <pubDate>Tue, 28 Feb 2012 10:04:55 GMT</pubDate>
    <dc:creator>Pavel_V_Intel</dc:creator>
    <dc:date>2012-02-28T10:04:55Z</dc:date>
    <item>
      <title>H.264 Decoder (IPP Sample): decoder crashes when invalid prefix size in bitstream</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800351#M3168</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I'm using the H.264 decoder from audio-video-codecs, version 7.0.6.&lt;BR /&gt;&lt;BR /&gt;In the method BuildNALUnit() in umc_h264_nal_spl.cpp, line 544, there is no check for the size of the input buffer in the call to memcpy. We've found an MPEG-4 clip whose prefix length is invalid for one sample in the file (generated from a Casio Digital Camera). This cause a crash since the input buffer is accessed outside of its length. Alsoa huge output buffer is allocated before the crash.&lt;BR /&gt;&lt;BR /&gt;Proposal: rewrite the BuildNALUnit to take a MediaData in place of a raw buffer for the buf parameter and check that the prefix length match the buffer length before doing allocating and copying memory around.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Pascal&lt;BR /&gt;&lt;BR /&gt;PS: Can somebody fix the incorrectly spelled "lenght"found inthe source code?&lt;BR /&gt;PS2: Sorry for my bad english.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 09:17:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800351#M3168</guid>
      <dc:creator>Pascal_Binggeli</dc:creator>
      <dc:date>2012-02-28T09:17:36Z</dc:date>
    </item>
    <item>
      <title>H.264 Decoder (IPP Sample): decoder crashes when invalid prefix</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800352#M3169</link>
      <description>Can you upload this stream? It will be useful for reproducing and testing purposes.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;Can somebody fix the incorrectly spelled "lenght"found inthe source code?&lt;/DIV&gt;&lt;DIV&gt;Done )&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Feb 2012 10:04:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800352#M3169</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2012-02-28T10:04:55Z</dc:date>
    </item>
    <item>
      <title>H.264 Decoder (IPP Sample): decoder crashes when invalid prefix</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800353#M3170</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;I have attached a file as a private message.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pascal</description>
      <pubDate>Tue, 28 Feb 2012 19:14:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800353#M3170</guid>
      <dc:creator>Pascal_Binggeli</dc:creator>
      <dc:date>2012-02-28T19:14:56Z</dc:date>
    </item>
    <item>
      <title>H.264 Decoder (IPP Sample): decoder crashes when invalid prefix</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800354#M3171</link>
      <description>&lt;DIV&gt;Good day.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;I suggest you not to use internal decoder MP4 parser (do not use AVC1_VIDEO subtype). There is MP4 splitter and it should be enough.However it requires somefixing too.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I made some changes for both of them.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;MP4 splitter fix:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;umc_index_spl.cpp, line 200, add buffer size check:&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;[cpp]            pDst[0] = 0; pDst[1] = 0; pDst[2] = 1;
            pDst += 3;
            buffer_size = in.GetBufferSize() - (pDst - (Ipp8u*)in.GetBufferPointer());
            if(buffer_size &amp;lt; NALUlen) // check nal size vs buffer size
                NALUlen = buffer_size;
            m_pReader-&amp;gt;GetData(pDst, NALUlen);[/cpp] &lt;/DIV&gt;&lt;DIV&gt;BuildNALUnit fix:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;umc_h264_nal_spl.h, line 132&lt;/DIV&gt;&lt;DIV&gt;change&lt;/DIV&gt;&lt;DIV&gt;[cpp]size_t BuildNALUnit(MediaDataEx * , Ipp8u * , Ipp32s lengthSize);[/cpp] to&lt;/DIV&gt;&lt;DIV&gt;[cpp]size_t BuildNALUnit(MediaDataEx * , Ipp8u *, size_t, Ipp32s lengthSize);[/cpp] line 179:&lt;/DIV&gt;&lt;DIV&gt;[cpp]    friend size_t UMC::BuildNALUnit(MediaDataEx *, Ipp8u *, Ipp32s );[/cpp] to&lt;/DIV&gt;[cpp]    friend size_t UMC::BuildNALUnit(MediaDataEx *, Ipp8u *, size_t, Ipp32s );[/cpp] &lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;umc_h264_nal_spl.cpp, line 657, add data size here:&lt;/DIV&gt;&lt;DIV&gt;[cpp]    for (i = 0; i &amp;lt; avcRecord.numOfSequenceParameterSets; i++)
    {
        size_t length = BuildNALUnit(&amp;amp;m_MediaData, p, (pSource-&amp;gt;GetDataSize() - (p - (Ipp8u*)pSource-&amp;gt;GetDataPointer())), D_BYTES_FOR_HEADER_LENGHT);
        p += length;
    }

    avcRecord.numOfPictureParameterSets = *p;
    p++;

    // read picture par sets
    for (i = 0; i &amp;lt; avcRecord.numOfPictureParameterSets; i++)
    {
        size_t length = BuildNALUnit(&amp;amp;m_MediaData, p, (pSource-&amp;gt;GetDataSize() - (p - (Ipp8u*)pSource-&amp;gt;GetDataPointer())), D_BYTES_FOR_HEADER_LENGHT);
        p += length;
    }[/cpp] and here, line 707:&lt;/DIV&gt;&lt;DIV&gt;[cpp]    size_t length = BuildNALUnit(&amp;amp;m_MediaData, (Ipp8u*)pSource-&amp;gt;GetDataPointer(), pSource-&amp;gt;GetDataSize(), avcRecord.lengthSizeMinusOne + 1);
    pSource-&amp;gt;MoveDataPointer((Ipp32s)length);[/cpp] &lt;/DIV&gt;&lt;DIV&gt;and check on line 530:&lt;/DIV&gt;&lt;DIV&gt;[cpp]    if(bufferSize &amp;lt; lengthSize)
        return 0;
    bufferSize -= lengthSize;
    size_t len = GetLenght(lengthSize, buf);
    if(len &amp;gt; bufferSize) // check nal vs buffer size
        len  = bufferSize;
    buf += lengthSize;[/cpp] &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Feb 2012 14:57:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800354#M3171</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2012-02-29T14:57:15Z</dc:date>
    </item>
    <item>
      <title>H.264 Decoder (IPP Sample): decoder crashes when invalid prefix</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800355#M3172</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the time taken to look into the issue. I will try to patch my version and let you know if this fix the problem. I'm not using the IPP mp4 splitter, only the decoder.&lt;BR /&gt;&lt;BR /&gt;I will keep you posted.&lt;BR /&gt;&lt;BR /&gt;Pascal</description>
      <pubDate>Wed, 14 Mar 2012 17:06:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264-Decoder-IPP-Sample-decoder-crashes-when-invalid-prefix/m-p/800355#M3172</guid>
      <dc:creator>Pascal_Binggeli</dc:creator>
      <dc:date>2012-03-14T17:06:16Z</dc:date>
    </item>
  </channel>
</rss>

