From 1b82dc6308fdaa3478b7adfd730977a4415dfdf1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 27 May 2013 00:36:51 +0000 Subject: Fix crash in forge.h when pushing atoms to a full buffer. --- lv2/lv2plug.in/ns/ext/atom/forge.h | 16 ++++++++-------- lv2/lv2plug.in/ns/ext/atom/lv2-atom.doap.ttl | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'lv2/lv2plug.in/ns/ext') diff --git a/lv2/lv2plug.in/ns/ext/atom/forge.h b/lv2/lv2plug.in/ns/ext/atom/forge.h index bd6f1e4..c825806 100644 --- a/lv2/lv2plug.in/ns/ext/atom/forge.h +++ b/lv2/lv2plug.in/ns/ext/atom/forge.h @@ -184,8 +184,8 @@ lv2_atom_forge_pop(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) static inline bool lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type) { - return forge->stack && - lv2_atom_forge_deref(forge, forge->stack->ref)->type == type; + return forge->stack && forge->stack->ref && + (lv2_atom_forge_deref(forge, forge->stack->ref)->type == type); } /** @@ -536,8 +536,8 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge, { sizeof(LV2_Atom_Object) - sizeof(LV2_Atom), forge->Resource }, { id, otype } }; - LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); - return lv2_atom_forge_push(forge, frame, out); + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); } /** @@ -553,8 +553,8 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge, { sizeof(LV2_Atom_Object) - sizeof(LV2_Atom), forge->Blank }, { id, otype } }; - LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); - return lv2_atom_forge_push(forge, frame, out); + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); } /** @@ -582,8 +582,8 @@ lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge, { sizeof(LV2_Atom_Sequence) - sizeof(LV2_Atom), forge->Sequence }, { unit, 0 } }; - LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); - return lv2_atom_forge_push(forge, frame, out); + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); } /** diff --git a/lv2/lv2plug.in/ns/ext/atom/lv2-atom.doap.ttl b/lv2/lv2plug.in/ns/ext/atom/lv2-atom.doap.ttl index d5e4d29..4c5fc68 100644 --- a/lv2/lv2plug.in/ns/ext/atom/lv2-atom.doap.ttl +++ b/lv2/lv2plug.in/ns/ext/atom/lv2-atom.doap.ttl @@ -12,6 +12,14 @@ doap:created "2007-00-00" ; doap:developer ; doap:release [ + doap:revision "1.5" ; + doap:created "2013-05-26" ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix crash in forge.h when pushing atoms to a full buffer." + ] + ] + ] , [ doap:revision "1.4" ; doap:created "2013-01-27" ; doap:file-release ; -- cgit v1.2.1