summaryrefslogtreecommitdiffstats
path: root/sub/osd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/osd.c')
-rw-r--r--sub/osd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sub/osd.c b/sub/osd.c
index 28a98892ce..e88df98afe 100644
--- a/sub/osd.c
+++ b/sub/osd.c
@@ -353,11 +353,8 @@ static void draw_on_image(void *ctx, struct sub_bitmaps *imgs)
{
struct draw_on_image_closure *closure = ctx;
struct osd_state *osd = closure->osd;
- if (closure->pool) {
- mp_image_pool_make_writeable(closure->pool, closure->dest);
- } else {
- mp_image_make_writeable(closure->dest);
- }
+ if (!mp_image_pool_make_writeable(closure->pool, closure->dest))
+ return; // on OOM, skip
mp_draw_sub_bitmaps(&osd->draw_cache, closure->dest, imgs);
talloc_steal(osd, osd->draw_cache);
closure->changed = true;