Fix T79484: Crash when viewing Movie Clip as a Background Image in a Camera
This seems to be caused by a change to the logic of movieclip_get_gputexture_ptr in rB97b597c. Differential Revision: https://developer.blender.org/D8469
This commit is contained in:
parent
3439cbcc69
commit
d71cb229d0
|
@ -1875,24 +1875,28 @@ static GPUTexture **movieclip_get_gputexture_ptr(MovieClip *clip,
|
|||
MovieClipUser *cuser,
|
||||
eGPUTextureTarget textarget)
|
||||
{
|
||||
LISTBASE_FOREACH (MovieClip_RuntimeGPUTexture *, tex, &clip->runtime.gputextures) {
|
||||
/* Check if we have an existing entry for that clip user. */
|
||||
MovieClip_RuntimeGPUTexture *tex;
|
||||
for (tex = clip->runtime.gputextures.first; tex; tex = tex->next) {
|
||||
if (memcmp(&tex->user, cuser, sizeof(MovieClipUser)) == 0) {
|
||||
if (tex == NULL) {
|
||||
tex = (MovieClip_RuntimeGPUTexture *)MEM_mallocN(sizeof(MovieClip_RuntimeGPUTexture),
|
||||
__func__);
|
||||
|
||||
for (int i = 0; i < TEXTARGET_COUNT; i++) {
|
||||
tex->gputexture[i] = NULL;
|
||||
}
|
||||
|
||||
memcpy(&tex->user, cuser, sizeof(MovieClipUser));
|
||||
BLI_addtail(&clip->runtime.gputextures, tex);
|
||||
}
|
||||
|
||||
return &tex->gputexture[textarget];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
/* If not, allocate a new one. */
|
||||
if (tex == NULL) {
|
||||
tex = (MovieClip_RuntimeGPUTexture *)MEM_mallocN(sizeof(MovieClip_RuntimeGPUTexture),
|
||||
__func__);
|
||||
|
||||
for (int i = 0; i < TEXTARGET_COUNT; i++) {
|
||||
tex->gputexture[i] = NULL;
|
||||
}
|
||||
|
||||
memcpy(&tex->user, cuser, sizeof(MovieClipUser));
|
||||
BLI_addtail(&clip->runtime.gputextures, tex);
|
||||
}
|
||||
|
||||
return &tex->gputexture[textarget];
|
||||
}
|
||||
|
||||
GPUTexture *BKE_movieclip_get_gpu_texture(MovieClip *clip, MovieClipUser *cuser)
|
||||
|
|
Loading…
Reference in New Issue