From 64fd099a3a431237e6d9d2deeed812700d884883 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Fri, 19 Aug 2016 17:18:16 +0300 Subject: [PATCH] isomp4: Fix coverity warning If atom_copy_data fails to write anything, return 0 CID #1371458 --- gst/isomp4/atoms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/atoms.c b/gst/isomp4/atoms.c index b2f7f748c7..f53004ebd8 100644 --- a/gst/isomp4/atoms.c +++ b/gst/isomp4/atoms.c @@ -2115,7 +2115,8 @@ sample_entry_tx3g_copy_data (SampleTableEntryTX3G * tx3g, guint8 ** buffer, Atom atom; atom_header_set (&atom, FOURCC_ftab, 18, 0); - atom_copy_data (&atom, buffer, size, offset); + if (!atom_copy_data (&atom, buffer, size, offset)) + return 0; prop_copy_uint16 (1, buffer, size, offset); /* Count must be 1 */ prop_copy_uint16 (1, buffer, size, offset); /* Font id: 1 */ prop_copy_size_string ((guint8 *) "Serif", 5, buffer, size, offset); @@ -2150,7 +2151,8 @@ sample_entry_tmcd_copy_data (SampleTableEntryTMCD * tmcd, guint8 ** buffer, guint64 name_offset = *offset; atom_header_set (&atom, FOURCC_name, 0, 0); - atom_copy_data (&atom, buffer, size, offset); + if (!atom_copy_data (&atom, buffer, size, offset)) + return 0; prop_copy_uint16 (strlen (tmcd->name.name), buffer, size, offset); prop_copy_uint16 (tmcd->name.language_code, buffer, size, offset); prop_copy_fixed_size_string ((guint8 *) tmcd->name.name,