Fixed a bug with files bigger than 2GB not being recognized. The accompanying error message was "File NAME has unknown type. Please have a look at the supported file types..."

This commit is contained in:
Moritz Bunkus 2003-08-12 16:15:41 +00:00
parent f77afb9a32
commit 8ff6f0aa0e
4 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,10 @@
2003-08-12 Moritz Bunkus <moritz@bunkus.org>
* Windows versions: Fixed a bug with files bigger than 2GB not
being recognized. The accompanying error message was "File NAME
has unknown type. Please have a look at the supported file
types..."
* all tools: Fixed a bug which would only allow Matroska files up
to 4GB to be read. The accompanying error message was "No segment
found" or something similar.

View File

@ -43,7 +43,7 @@ void usage(int retval) {
int main(int argc, char *argv[]) {
int maxlen;
int64_t size;
uint64_t size;
unsigned char *buffer;
char mode;
string s, line;

View File

@ -309,7 +309,7 @@ static void usage() {
static int get_type(char *filename) {
mm_io_c *mm_io;
mm_text_io_c *mm_text_io;
off_t size;
uint64_t size;
int type;
try {

View File

@ -166,8 +166,10 @@ uint64 mm_io_c::getFilePointer() {
DWORD low;
low = SetFilePointer((HANDLE)file, 0, &high, FILE_CURRENT);
if ((low == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR))
if ((low == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
printf("nonono\n");
return (uint64)-1;
}
return (((uint64)high) << 32) | (uint64)low;
}
@ -188,8 +190,8 @@ void mm_io_c::setFilePointer(int64 offset, seek_mode mode) {
break;
}
high = offset >> 32;
SetFilePointer((HANDLE)file, offset & 0xffffffff, &high, method);
high = (LONG)(offset >> 32);
SetFilePointer((HANDLE)file, (LONG)(offset & 0xffffffff), &high, method);
}
uint32 mm_io_c::read(void *buffer, size_t size) {