Skip to content

Commit e188ecb

Browse files
matrixreloadxinzhengzhang
authored andcommitted
ios/glview: fix crash when capture image from a zero bounds
Signed-off-by: Xinzheng Zhang <zhangxzheng@gmail.com>
1 parent affc5fd commit e188ecb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ios/IJKMediaPlayer/IJKMediaPlayer/ijkmedia/ijksdl/ios/IJKSDLGLView.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ - (UIImage*)snapshotInternal
559559

560560
- (UIImage*)snapshotInternalOnIOS7AndLater
561561
{
562+
if (CGSizeEqualToSize(self.bounds.size, CGSizeZero)) {
563+
return nil;
564+
}
562565
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0.0);
563566
// Render our snapshot into the image context
564567
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO];

0 commit comments

Comments
 (0)