Check stat for a proper return value. If it failes return zero length for
From: Erik Hovland <erik@hovland.org>
file to check.
---
libs/libmyth/util.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libs/libmyth/util.cpp b/libs/libmyth/util.cpp
index 97c289a..13396d5 100644
|
a
|
b
|
unsigned long long myth_get_approximate_large_file_size(const QString &fname)
|
| 946 | 946 | return status.st_size; |
| 947 | 947 | #else |
| 948 | 948 | struct stat status; |
| 949 | | stat(filename.local8Bit(), &status); |
| | 949 | if (stat(filename.local8Bit(), &status) == -1) |
| | 950 | return 0; |
| | 951 | |
| 950 | 952 | // Using off_t requires a lot of 32/64 bit checking. |
| 951 | 953 | // So just get the size in blocks. |
| 952 | 954 | unsigned long long bsize = status.st_blksize; |