Commit 86816a95 authored by Felix Paul Kühne's avatar Felix Paul Kühne

thumbnail cache: fix another potential runtime exception

parent 435494e6
......@@ -196,11 +196,12 @@ static NSCache *_thumbnailCacheMetadata;
}
UIGraphicsBeginImageContext(imageSize);
for (NSUInteger i = 0; i < fileNumber; i++) {
NSUInteger iter = files.count < fileNumber ? files.count : fileNumber;
for (NSUInteger i = 0; i < iter; i++) {
MLFile *file = [files objectAtIndex:i];
clusterThumb = [VLCThumbnailsCache thumbnailForMediaFile:file];
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat imagePartWidth = (imageSize.width / fileNumber);
CGFloat imagePartWidth = (imageSize.width / iter);
//the rect in which the image should be drawn
CGRect clippingRect = CGRectMake(imagePartWidth * i, 0, imagePartWidth, imageSize.height);
CGContextSaveGState(context);
......
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