fn from_bytes<R: ReadBytes>(stream: &mut R) -> io::Result<Self> {
        let count = u32::from_bytes(stream)?;
        let offset = if stream.version() == 0 {
            let offset = u32::from_bytes(stream)?;
            std::cmp::min(offset, 0x7fffffff) as i32
        } else {
            i32::from_bytes(stream)?
        };
        Ok(CompositionOffsetEntry { count, offset })
    }
// NOTE: This implementation is not _entirely_ correct. If in a
// version 0 entry the offset >= 2^31 it breaks horribly.
This implementation is not _entirely_ correct. If in a
version 0 entry the offset >= 2^31 it breaks horribly.
This implementation is not _entirely_ correct . If in a version 0 entry the offset > = 2^31 it breaks horribly .
fn from_bytes<R: ReadBytes>(stream: &mut R) -> io::Result<Self> {
        let count = u32::from_bytes(stream)?;
        let offset = if stream.version() == 0 {
            let offset = u32::from_bytes(stream)?;
            std::cmp::min(offset, 0x7fffffff) as i32
        } else {
            i32::from_bytes(stream)?
        };
        Ok(CompositionOffsetEntry { count, offset })
    }
fn from_bytes < R : ReadBytes > ( stream : & mut R ) -> io :: Result < Self > { let count = u32 :: from_bytes ( stream ) ? ; let offset = if stream . version ( ) == 0 { let offset = u32 :: from_bytes ( stream ) ? ; std :: cmp :: min ( offset , 0x7fffffff ) as i32 } else { i32 :: from_bytes ( stream ) ? } ; Ok ( CompositionOffsetEntry { count , offset } ) }
NOTE: This implementation is not _entirely_ correct.
NOTE : This implementation is not _entirely_ correct .
stream
&mut R
stream
&mut R