File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -959,19 +959,23 @@ static ssize_t ebml_parse_var_int(unsigned char *buffer,
959959 return size ;
960960}
961961
962- /* Parse a normal int that may be from 1-8 bytes long.
962+ /* Parse a big-endian int that may be from 1-8 bytes long.
963963 * Returns 0 if there's not enough space to read the number;
964964 * Returns -1 if the number is mis-sized.
965965 * Else, returns the length of the number in bytes and writes the
966966 * value to *out_value.
967+ * If is_signed is true, then the int is assumed to be two's complement
968+ * signed, negative values will be correctly promoted, and the returned
969+ * long long can be safely cast to a signed number on systems using
970+ * two's complement arithmatic.
967971 */
968972static ssize_t ebml_parse_sized_int (unsigned char * buffer ,
969- unsigned char * buffer_end ,
970- size_t len ,
971- int is_signed ,
972- unsigned long long * out_value )
973+ unsigned char * buffer_end ,
974+ size_t len ,
975+ int is_signed ,
976+ unsigned long long * out_value )
973977{
974- long long value ;
978+ unsigned long long value ;
975979 size_t i ;
976980
977981 if (len < 1 || len > 8 ) {
You can’t perform that action at this time.
0 commit comments