Commit 2a4872c3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

surface_add_association: properly handle failure to add association to surface.

Remove association buffers if adding did not work properly.
parent 1c34ed63
...@@ -215,6 +215,8 @@ int surface_add_association( ...@@ -215,6 +215,8 @@ int surface_add_association(
if (obj_surface->assocs[i]->subpicture == assoc->subpicture) { if (obj_surface->assocs[i]->subpicture == assoc->subpicture) {
/* XXX: this should not happen, but replace it in the interim */ /* XXX: this should not happen, but replace it in the interim */
ASSERT(obj_surface->assocs[i]->surface == assoc->surface); ASSERT(obj_surface->assocs[i]->surface == assoc->surface);
SubpictureAssociation *a = obj_surface->assocs[i];
free(a); /* XXX: release previous association */
obj_surface->assocs[i] = assoc; obj_surface->assocs[i] = assoc;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment