Ticket #1038: 1038.patch

File 1038.patch, 879 bytes (added by PhuongNguyen, 10 years ago)

Patch for ticket #1038

  • source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

     
    222222  if( m_uiValue >= scaledRange )
    223223  {
    224224    ruiBin = 1;
     225    // When termination bin is 1, the spec requires that the last bit inserted from
     226    // the bitstream to the offset must be one.
     227    assert ((m_uiValue >> 7) & 1);
     228    // Also, if the bitstream is not byte-aligned, the remaining bits up to byte-alignment must be 0.
     229    UInt numBits = m_pcTComBitstream->getNumBitsUntilByteAligned();
     230    if(numBits)
     231    {
     232      assert(numBits <= m_pcTComBitstream->getNumBitsLeft());
     233      UInt code;
     234      m_pcTComBitstream->pseudoRead( numBits, code );
     235      assert(code == 0);
     236    }
    225237  }
    226238  else
    227239  {