summaryrefslogtreecommitdiffstats
path: root/sub/ass_mp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r--sub/ass_mp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index bb003a3edd..d5d9e3e7d6 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -230,8 +230,10 @@ static bool pack(struct mp_ass_packer *p, struct sub_bitmaps *res, int imgfmt)
{
talloc_free(p->cached_img);
p->cached_img = mp_image_alloc(imgfmt, p->packer->w, p->packer->h);
- if (!p->cached_img)
+ if (!p->cached_img) {
+ packer_reset(p->packer);
return false;
+ }
talloc_steal(p, p->cached_img);
}