Add a missing NULL check before releasing a texture ref.
This causes a crash if the NV12 texture cache attempts to upload textures for a frame with a NULL backing CVPixelBufferRef. Bug: webrtc:10175 Change-Id: I6866dcde5ace745cbd95b762254294aa8406c2a5 Reviewed-on: https://webrtc-review.googlesource.com/c/115430 Commit-Queue: Chuck Hays <haysc@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26140}
This commit is contained in:
@ -60,8 +60,10 @@
|
||||
kCFAllocatorDefault, _textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, pixelFormat, width,
|
||||
height, pixelFormat, GL_UNSIGNED_BYTE, planeIndex, textureOut);
|
||||
if (ret != kCVReturnSuccess) {
|
||||
CFRelease(*textureOut);
|
||||
*textureOut = nil;
|
||||
if (*textureOut) {
|
||||
CFRelease(*textureOut);
|
||||
*textureOut = nil;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
NSAssert(CVOpenGLESTextureGetTarget(*textureOut) == GL_TEXTURE_2D,
|
||||
|
||||
Reference in New Issue
Block a user