examples: warn when texture locking fails

New SDL seems to fail when locking YUY2 now.
This commit is contained in:
Wim Taymans 2025-03-20 11:21:56 +01:00
parent 4e0545aa04
commit 7662a01f85
6 changed files with 21 additions and 6 deletions

View file

@ -304,7 +304,8 @@ static int port_set_format(void *object,
SDL_TEXTUREACCESS_STREAMING,
d->format.size.width,
d->format.size.height);
SDL_LockTexture(d->texture, NULL, &dest, &d->stride);
if (SDL_LockTexture(d->texture, NULL, &dest, &d->stride) < 0)
return -EINVAL;
SDL_UnlockTexture(d->texture);
}