Show
Ignore:
Timestamp:
08/17/08 00:12:18 (5 months ago)
Author:
hobu
Message:

Fix #68 - incorrect return type for the length of the VLR in the ReadVLR functions

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/detail/reader10.cpp

    r816 r830  
    224224        read_n(vlrh, m_ifs, sizeof(VLRHeader)); 
    225225 
    226         int16_t count = vlrh.recordLengthAfterHeader; 
     226        uint16_t length = vlrh.recordLengthAfterHeader; 
     227        if (length < 1) { 
     228            throw std::domain_error("VLR record length must be at least 1 byte long"); 
     229        } 
    227230          
    228231        std::vector<uint8_t> data; 
    229         data.resize(count); 
     232        data.resize(length); 
    230233 
    231234        read_n(data.front(), m_ifs, count);