Ticket #1038: 1038.2.patch

File 1038.2.patch, 713 bytes (added by PhuongNguyen, 11 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 Remaining = (m_uiValue & 0x007f) >> (8 + m_bitsNeeded);
     230    assert (Remaining == 0);
    225231  }
    226232  else
    227233  {