summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2014-11-07 14:49:18 -0400
committerRodger Combs <rodger.combs@gmail.com>2014-11-08 10:39:28 -0600
commit0e8772a3bdca491230c90d3c9c7ab2ac5c18c2e7 (patch)
tree9464ee1d05593d4abbeb321d84aa42264d1ad6f0 /libass/ass_render.c
parenta31ea5621a1fca4a4c927d11ece43c36b44b372c (diff)
downloadlibass-0e8772a3bdca491230c90d3c9c7ab2ac5c18c2e7.tar.bz2
libass-0e8772a3bdca491230c90d3c9c7ab2ac5c18c2e7.tar.xz
Check more allocations
Part of #146
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index d1a47ee..c1cf548 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1883,7 +1883,8 @@ static void make_shadow_bitmap(CombinedBitmapInfo *info, ASS_Renderer *render_pr
} else
info->bm_s = copy_bitmap(info->bm);
- assert(info->bm_s);
+ if (!info->bm_s)
+ return;
// Works right even for negative offsets
// '>>' rounds toward negative infinity, '&' returns correct remainder
@@ -2557,11 +2558,15 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
int offset_y = (info->pos.y >> 6) - current_info->pos.y;
if(info->bm){
current_info->bm = copy_bitmap(info->bm);
+ if (!current_info->bm)
+ goto cleanup;
current_info->bm->left += offset_x;
current_info->bm->top += offset_y;
}
if(info->bm_o){
current_info->bm_o = copy_bitmap(info->bm_o);
+ if (!current_info->bm_o)
+ goto cleanup;
current_info->bm_o->left += offset_x;
current_info->bm_o->top += offset_y;
}
@@ -2593,6 +2598,7 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
}
}
}
+ cleanup:
info = info->next;
}
}