diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index 0a5644f8d..8ecad3e01 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -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); } diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index 2093a9b48..3a2ef35dc 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -210,7 +210,8 @@ static int port_set_format(void *object, enum spa_direction direction, uint32_t 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); } diff --git a/src/examples/video-play-fixate.c b/src/examples/video-play-fixate.c index b59be31b5..8503a6b3d 100644 --- a/src/examples/video-play-fixate.c +++ b/src/examples/video-play-fixate.c @@ -332,7 +332,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param) SDL_TEXTUREACCESS_STREAMING, data->size.width, data->size.height); - SDL_LockTexture(data->texture, NULL, &d, &data->stride); + if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) { + pw_stream_set_error(stream, -EINVAL, "invalid texture format"); + return; + } SDL_UnlockTexture(data->texture); /* a SPA_TYPE_OBJECT_ParamBuffers object defines the acceptable size, diff --git a/src/examples/video-play-pull.c b/src/examples/video-play-pull.c index f9492edea..3ae69f55d 100644 --- a/src/examples/video-play-pull.c +++ b/src/examples/video-play-pull.c @@ -382,7 +382,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param) SDL_TEXTUREACCESS_STREAMING, data->size.width, data->size.height); - SDL_LockTexture(data->texture, NULL, &d, &data->stride); + if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) { + pw_stream_set_error(stream, -EINVAL, "invalid texture format"); + return; + } SDL_UnlockTexture(data->texture); switch(sdl_format) { diff --git a/src/examples/video-play-reneg.c b/src/examples/video-play-reneg.c index c93ed24de..b8e83d233 100644 --- a/src/examples/video-play-reneg.c +++ b/src/examples/video-play-reneg.c @@ -225,7 +225,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param) SDL_TEXTUREACCESS_STREAMING, data->size.width, data->size.height); - SDL_LockTexture(data->texture, NULL, &d, &data->stride); + if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) { + pw_stream_set_error(stream, -EINVAL, "invalid texture format"); + return; + } SDL_UnlockTexture(data->texture); /* a SPA_TYPE_OBJECT_ParamBuffers object defines the acceptable size, diff --git a/src/examples/video-play.c b/src/examples/video-play.c index 53041f284..6a12f2cc9 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -348,7 +348,11 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param) SDL_TEXTUREACCESS_STREAMING, data->size.width, data->size.height); - SDL_LockTexture(data->texture, NULL, &d, &data->stride); + if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) { + fprintf(stderr, "Couldn't lock texture: %s\n", SDL_GetError()); + pw_stream_set_error(stream, -EINVAL, "invalid format"); + return; + } SDL_UnlockTexture(data->texture); switch(sdl_format) {