summaryrefslogtreecommitdiffstats
path: root/sub/img_convert.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-11-23 20:46:25 +0100
committersfan5 <sfan5@live.de>2023-11-24 10:04:55 +0100
commitaa362fdcf440fb747c3aeb377ce51d91cc05f38b (patch)
tree3a363fc3e2d4d52d1a02382e5d815be2aba455a7 /sub/img_convert.c
parente22a2f04833852ce825eb7c1235d9bdaaa9b2397 (diff)
downloadmpv-aa362fdcf440fb747c3aeb377ce51d91cc05f38b.tar.bz2
mpv-aa362fdcf440fb747c3aeb377ce51d91cc05f38b.tar.xz
various: replace some OOM handling
We prefer to fail fast rather than degrade in unpredictable ways. The example in sub/ is particularly egregious because the code just skips the work it's meant to do when an allocation fails.
Diffstat (limited to 'sub/img_convert.c')
-rw-r--r--sub/img_convert.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sub/img_convert.c b/sub/img_convert.c
index a70bb0a24c..3c18e1713a 100644
--- a/sub/img_convert.c
+++ b/sub/img_convert.c
@@ -31,7 +31,8 @@
void mp_blur_rgba_sub_bitmap(struct sub_bitmap *d, double gblur)
{
struct mp_image *tmp1 = mp_image_alloc(IMGFMT_BGRA, d->w, d->h);
- if (tmp1) { // on OOM, skip region
+ MP_HANDLE_OOM(tmp1);
+ {
struct mp_image s = {0};
mp_image_setfmt(&s, IMGFMT_BGRA);
mp_image_set_size(&s, d->w, d->h);