Commit 3f409199 authored by Felix Paul Kühne's avatar Felix Paul Kühne

http file downloader: fix integer overflow

(cherry picked from commit 0aed389d)
parent ae706745
......@@ -20,7 +20,7 @@
@interface VLCHTTPFileDownloader ()
{
NSString *_filePath;
NSUInteger _expectedDownloadSize;
long long _expectedDownloadSize;
NSUInteger _receivedDataSize;
NSString *_fileName;
NSURLConnection *_urlConnection;
......@@ -113,6 +113,7 @@
[self _downloadEnded];
} else {
_expectedDownloadSize = [response expectedContentLength];
APLog(@"expected download size: %lli", _expectedDownloadSize);
if (_expectedDownloadSize < [[UIDevice currentDevice] freeDiskspace].longLongValue)
[self.delegate downloadStarted];
else {
......@@ -125,7 +126,6 @@
otherButtonTitles:nil];
[alert show];
}
APLog(@"expected download size: %lu", (unsigned long)_expectedDownloadSize);
}
} else {
APLog(@"unhandled status code %lu", (unsigned long)_statusCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment