Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1295 from achambers16/fix-endprocess-loop

Fix infinite loops related to endProcess on GPUImageFilter
  • Loading branch information...
commit 2e8df3d0501700ff9dbb1597f160c7d51cc76da2 2 parents a863966 + abe404b
@BradLarson authored
View
1  framework/Source/GPUImageFilter.h
@@ -57,6 +57,7 @@ typedef struct GPUMatrix3x3 GPUMatrix3x3;
GLfloat backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha;
BOOL preparedToCaptureImage;
+ BOOL isEndProcessing;
// Texture caches are an iOS-specific capability
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
View
9 framework/Source/GPUImageFilter.m
@@ -1002,9 +1002,14 @@ - (CGSize)maximumOutputSize;
- (void)endProcessing
{
- for (id<GPUImageInput> currentTarget in targets)
+ if (!isEndProcessing)
{
- [currentTarget endProcessing];
+ isEndProcessing = YES;
+
+ for (id<GPUImageInput> currentTarget in targets)
+ {
+ [currentTarget endProcessing];
+ }
}
}
View
1  framework/Source/GPUImageFilterGroup.h
@@ -4,6 +4,7 @@
@interface GPUImageFilterGroup : GPUImageOutput <GPUImageInput, GPUImageTextureDelegate>
{
NSMutableArray *filters;
+ BOOL isEndProcessing;
}
@property(readwrite, nonatomic, strong) GPUImageOutput<GPUImageInput> *terminalFilter;
View
9 framework/Source/GPUImageFilterGroup.m
@@ -182,9 +182,14 @@ - (CGSize)maximumOutputSize;
- (void)endProcessing;
{
- for (GPUImageOutput<GPUImageInput> *currentFilter in _initialFilters)
+ if (!isEndProcessing)
{
- [currentFilter endProcessing];
+ isEndProcessing = YES;
+
+ for (id<GPUImageInput> currentTarget in targets)
+ {
+ [currentTarget endProcessing];
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.