From: Thiago Sousa Santos Date: Mon, 16 Nov 2009 17:57:53 +0000 (-0300) Subject: qtmux: do not add size to the pointer variable X-Git-Tag: RELEASE-0.10.29~191 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f90d335096b362efbd84931295e6b0939947967;p=platform%2Fupstream%2Fgst-plugins-good.git qtmux: do not add size to the pointer variable Do not wrongly add the result of the function to the pointer to the buffer size. Instead, check the result to see if the serialization was ok. Based on a patch by: "Carsten Kroll " Fixes #602106 --- diff --git a/gst/quicktime/atoms.c b/gst/quicktime/atoms.c index a0844c2e9..57b9aa483 100644 --- a/gst/quicktime/atoms.c +++ b/gst/quicktime/atoms.c @@ -1909,11 +1909,15 @@ atom_stsd_copy_data (AtomSTSD * stsd, guint8 ** buffer, guint64 * size, break; default: if (se->kind == VIDEO) { - size += sample_entry_mp4v_copy_data ((SampleTableEntryMP4V *) - walker->data, buffer, size, offset); + if (!sample_entry_mp4v_copy_data ((SampleTableEntryMP4V *) + walker->data, buffer, size, offset)) { + return 0; + } } else if (se->kind == AUDIO) { - size += sample_entry_mp4a_copy_data ((SampleTableEntryMP4A *) - walker->data, buffer, size, offset); + if (!sample_entry_mp4a_copy_data ((SampleTableEntryMP4A *) + walker->data, buffer, size, offset)) { + return 0; + } } else { if (!atom_hint_sample_entry_copy_data ( (AtomHintSampleEntry *) walker->data, buffer, size, offset)) {