debian/0000775000000000000000000000000012115103735007166 5ustar debian/libg3d0.install0000664000000000000000000000002612115103646012001 0ustar usr/lib/*/libg3d.so.* debian/libg3d-doc.doc-base0000664000000000000000000000051012115103646012471 0ustar Document: libg3d Title: LibG3D Development Documentation Author: Markus Dahms Abstract: This document provides an introduction to LibG3D and describes the data structures and functions of the library. Section: Programming/C Format: HTML Index: /usr/share/gtk-doc/html/libg3d/index.html Files: /usr/share/gtk-doc/html/libg3d/* debian/changelog0000664000000000000000000002336412115103721011043 0ustar libg3d (0.0.8-17ubuntu1) raring; urgency=low * Add simple autopkgtest to package. -- Vibhav Pant Mon, 04 Mar 2013 12:38:57 +0100 libg3d (0.0.8-17) unstable; urgency=low * Enable all hardening flags in debian/rules * Upgraded to policy 3.9.3, no changes required * debian/patches: - Add implicit_declaration.patch, Fix implicit declarations of functions * Use buildflags.mk to set security flags in debian/rules * Use DEB_LDFLAGS_MAINT_APPEND to add --as-needed linker flag * Upgrade debhelper compat to v9 -- Sven Eckelmann Sat, 28 Apr 2012 12:11:26 +0200 libg3d (0.0.8-16) unstable; urgency=low * Update copyright years in debian/copyright * debian/patches: Add pkglib_data.patch, Fix build with automake 1.11.3 (Closes LP: #935226) * Disable libmagic support until a workaround is added -- Sven Eckelmann Sun, 19 Feb 2012 02:27:51 +0100 libg3d (0.0.8-15) unstable; urgency=low * Use dh_autoreconf in debian/rules to fix --as-needed bug in libtool * Add optional dependencies to libg3d-dev * Mark all targets in debian/rules as phony * Remove hardening-includes which are now integrated in dpkg- buildflags * Use debian packaging manual URL as format identifier in debian/copyright -- Sven Eckelmann Mon, 31 Oct 2011 11:31:33 +0100 libg3d (0.0.8-14) unstable; urgency=low * Upgraded to policy 3.9.2, no changes required * Update Vcs-* fields to new anonscm.debian.org URLs in debian/control * Add multiarch support (Closes: #623766) -- Sven Eckelmann Sat, 11 Jun 2011 16:49:48 +0200 libg3d (0.0.8-13) unstable; urgency=low * Upload to unstable * Updated my maintainer e-mail address * Keep dependencies on separate lines in debian/control * debian/copyright: - Update to DEP5 revision 164 - Update copyright years -- Sven Eckelmann Sun, 06 Feb 2011 11:52:28 +0100 libg3d (0.0.8-12) experimental; urgency=low * Upgrade debhelper compat to v8 * set *FLAGS using dpkg-buildflags in debian/rules to work like dpkg-buildpackage when called directly * Use hardening-includes for CFLAGS and LDFLAGS hardened builds * Explicit build depend on pkg-config -- Sven Eckelmann Thu, 23 Sep 2010 13:37:09 +0200 libg3d (0.0.8-11) unstable; urgency=low * Upgraded to policy 3.9.1, no changes required * debian/patches: - Add fix-memory-leaks-3.patch, Fix memory leaks in core (Closes: #593209) - Add fix-memory-leaks-dae.patch, Fix memory leaks in dae plugin (Closes: #593209) -- Sven Eckelmann Mon, 16 Aug 2010 21:29:40 +0200 libg3d (0.0.8-10) unstable; urgency=low * debian/patches: - Add fix-memory-leaks-2.patch, Fix memory leaks (Closes: #570084) Thanks Picca Frederic-Emmanuel - Add pc-glib2-private.patch, Only require glib2.0 for header files when using pkg-config * Remove outdated README.source * debian/rules: - Enable parallel builds using dh's --parallel - Inform about missing installed files using dh's --list-missing * Upgraded to policy 3.9.0, no changes required -- Sven Eckelmann Mon, 28 Jun 2010 23:51:12 +0200 libg3d (0.0.8-9) unstable; urgency=low * Correct spelling errors found by lintian * debian/copyright: Update copyright years * Upgraded to policy 3.8.4, no changes required * debian/patches: - Add load-so-modules.patch, Identify modules by the ending .so instead of .la (Closes: #568797) -- Sven Eckelmann Mon, 08 Feb 2010 10:39:30 +0100 libg3d (0.0.8-8) unstable; urgency=low * Register HTML documentation in doc-base * debian/patches: - Add configure-cxx.patch, Add AC_PROG_CXX for tests/Makefile.am - Add autoreconf-libtool.patch, Allow libtool to refresh its own files to keep them consistent - Remove distclean-xml.patch, Distclean isn't run anymore in clean target - Remove link-as-needed.patch, ltmain.sh is replaced by Debian's ltmain.sh * Recreate autotool generated files before configure * Build html gtk-docs and don't use version included in orig.tar.gz * Don't install .la files anymore, there are no .la files which references them, but they are known to cause unnecessary dependencies -- Sven Eckelmann Sat, 26 Dec 2009 11:08:28 +0100 libg3d (0.0.8-6) unstable; urgency=low * Convert to 3.0 (quilt) source format * debian/control: - Remove unneeded build dependency to quilt - Build-depend on autotools-dev to allow cdbs to update config.sub and config.guess - Remove cdbs and change debhelper dependency to 7 for for dh support * Rewrote debian/rules with dh * debian/patches: - Add distclean-xml.patch, Don't remove shipped xml files when calling distclean -- Sven Eckelmann Mon, 16 Nov 2009 01:31:39 +0100 libg3d (0.0.8-5) unstable; urgency=low * Reduce debhelper dependency to 5 * Re-enable filetype detection using libmagic * Convert debian/copyright to new dep5 version * Upgraded to policy 3.8.3, no changes required * Add README.source with information about patch management * debian/patches: - Change to dep3 patch tagging guidelines - Remove number before patches as order is given by debian/patches/series * Remove shlibs:Depends for binary packages without shared libs dependencies -- Sven Eckelmann Fri, 30 Oct 2009 17:58:34 +0100 libg3d (0.0.8-4) unstable; urgency=low * Correct changelog entry for libg3d-0.0.8-3 -- Sven Eckelmann Sat, 09 May 2009 17:00:06 +0200 libg3d (0.0.8-3) unstable; urgency=low * debian/rules: - Rewrote using cdbs - Only make disappearing of symbols a fatal error for dh_makeshlibs * debian/control: - Move Vcs-* to git.debian.org - Move libg3d-dbg to new section debug - Upgraded to policy 3.8.1, no changes required - Allow Debian Maintainers to upload new versions of libg3d * debian/patches: - Add 102-endless-seek.patch to fix possible infinite loop in g3d_stream_skip -- Sven Eckelmann Wed, 06 May 2009 13:15:31 +0200 libg3d (0.0.8-2) unstable; urgency=low * Add package libg3d-dbg with debug symbols * Shorten copied descriptions in debian/control * debian/rules: - Run configure only once for both binary-indep and binary-arch - Use quilt to manage patches * debian/patches: - Add 100-fix-memory-leaks.patch, fix memory leaks of plugins - Add 101-link-as-needed.patch, reduce unneeded linking against libraries -- Sven Eckelmann Sun, 15 Feb 2009 11:38:53 +0100 libg3d (0.0.8-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Mon, 19 Jan 2009 11:16:45 +0100 libg3d (0.0.7-1) experimental; urgency=low * New Upstream Version * debian/copyright: - Add new authors - Add email address of Oliver Dippel * Remove upstream merged patches/100-read-float-on-big-endian.patch * debian/control: - Remove quilt dependency - Build-Depend on libgsf-(gnome-)1-dev for new plugins - Build-Depend on libz-dev for deflated streams support - Add COLLADA, ASE, LDraw and KMZ to supported format list * debian/rules: - Compile outside the source directory - Use precompiled api docs instead of recompiling it again - Allow to disable gcc optimisations by using DEB_BUILD_OPTIONS noopt - Allow parallels builds by using DEB_BUILD_OPTIONS parallel=n - Replace dh_clean -k with dh_prep - Remove top level -stamp files with dh_clean (>= 7) * Provide symbol file for libg3d0 and fail if it doesn't match with libg3d0 symbols -- Sven Eckelmann Fri, 16 Jan 2009 19:15:31 +0100 libg3d (0.0.6-6) unstable; urgency=low * Remove Timo Schneider as Maintainer and change it to myself (Closes: #507390) -- Sven Eckelmann Mon, 01 Dec 2008 00:36:03 +0100 libg3d (0.0.6-5) unstable; urgency=low * Replace libg3d@packages.debian.org maintainer with first Uploader in debian/control * Build depend on flex to fix warning of libg3d plugin loader * Add additional information to 100-read-float-on-big-endian.patch -- Sven Eckelmann Sat, 29 Nov 2008 20:17:59 +0100 libg3d (0.0.6-4) unstable; urgency=low * Remove symbol file for libg3d0 * Don't fail if symbol file doesn't match with libg3d0 symbols or symbol file was not provided -- Sven Eckelmann Tue, 11 Nov 2008 15:36:59 +0100 libg3d (0.0.6-3) unstable; urgency=low * Only depend on libglib2.0-dev in -dev packages * Add separate copyright information for debian/* to debian/copyright -- Sven Eckelmann Wed, 15 Oct 2008 13:57:45 +0200 libg3d (0.0.6-2) unstable; urgency=low * Fix lintian warnings - Only call distclean when a makefile is present - Add standard depends to fix missing depend on libc - Provide symbol file for libg3d0 and fail if it doesn't match with libg3d0 symbols - Add watch file * Promote libg3d-plugins to "Recommends" for libg3d0 * Include /usr/share/quilt/quilt.make in debian/rules to manage patches and add quilt (>= 0.40) to Build-Depends. * Fix reading of filetypes with floats on big endian systems (Closes: #501809) * Add homepage to control file * Move copyright to new copyright format * Add Vcs information to debian/control * Add myself to Uploaders list as discussed with Timo Schneider -- Sven Eckelmann Fri, 10 Oct 2008 18:49:09 +0200 libg3d (0.0.6-1) unstable; urgency=low * initial release -- Timo Schneider Tue, 19 Dec 2006 01:04:31 +0100 debian/libg3d-doc.install0000664000000000000000000000004012115103646012460 0ustar usr/share/gtk-doc/html/libg3d/* debian/gbp.conf0000664000000000000000000000005712115103646010610 0ustar [DEFAULT] pristine-tar = True sign-tags = True debian/compat0000664000000000000000000000000212115103646010365 0ustar 9 debian/tests/0000775000000000000000000000000012115103734010327 5ustar debian/tests/control0000664000000000000000000000006112115103664011731 0ustar Tests: build Depends: libg3d-dev, build-essentialdebian/tests/build0000664000000000000000000000137212115103664011356 0ustar #!/bin/sh # autopkgtest check: Build and run a program against libg3d, to verify that the # headers are installed correctly # Source taken from http://leenissen.dk/fann/wp/help/getting-started/ # (C) 2013 Vibhav Pant # Author: Vibhav Pant set -e WORKDIR=$(mktemp -d) trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM cd $WORKDIR cat < g3d_test.c #include #include int main(void) { G3DContext *context; context = g3d_context_new(); g3d_context_update_progress_bar(context, 40, TRUE); g3d_context_free(context); return 0; } EOF gcc -o g3d_test g3d_test.c `pkg-config --cflags --libs libg3d` -Wall -Werror echo "build: OK" [ -x g3d_test ] ./g3d_test echo "run: OK"debian/source/0000775000000000000000000000000012115103734010465 5ustar debian/source/format0000664000000000000000000000001412115103646011675 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000000464512115103646011133 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libg3d Upstream-Contact: Markus Dahms Source: https://gna.org/projects/libg3d/ Files: * Copyright: 2005-2009, Markus Dahms 2006, Romain Behar 2006, Oliver Dippel 2006, Marek Lindner 2008, Peter Fritzsche 2008, Sven Eckelmann 2008, Martin Gerhardy License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems the full text of the GNU Lesser General Public License, version 2.1 or later, can be found in the `/usr/share/common-licenses/LGPL-2.1' file. Files: debian/* Copyright: 2006, Timo Schneider 2008-2012, Sven Eckelmann License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/libg3d0.symbols0000664000000000000000000000777412115103646012044 0ustar libg3d.so.0 libg3d0 #MINVER# g3d_context_free@Base 0.0.3 g3d_context_new@Base 0.0.3 g3d_context_set_bgcolor@Base 0.0.3 g3d_context_set_set_bgcolor_func@Base 0.0.3 g3d_context_set_update_interface_func@Base 0.0.3 g3d_context_set_update_progress_bar_func@Base 0.0.3 g3d_context_update_interface@Base 0.0.3 g3d_context_update_progress_bar@Base 0.0.3 g3d_face_free@Base 0.0.3 g3d_face_get_normal@Base 0.0.3 g3d_gsf_input_stream_get_type@Base 0.0.7 g3d_gsf_input_stream_new@Base 0.0.7 g3d_iff_check@Base 0.0.7 g3d_iff_chunk_matches@Base 0.0.5 g3d_iff_debug_chunk@Base 0.0.6 g3d_iff_get_chunk_info@Base 0.0.6 g3d_iff_handle_chunk@Base 0.0.7 g3d_iff_id_to_text@Base 0.0.5 g3d_iff_open@Base 0.0.3 g3d_iff_read_chunk@Base 0.0.7 g3d_iff_read_ctnr@Base 0.0.7 g3d_iff_readchunk@Base 0.0.5 g3d_material_free@Base 0.0.3 g3d_material_new@Base 0.0.3 g3d_matrix_determinant@Base 0.0.7 g3d_matrix_dump@Base 0.0.5 g3d_matrix_identity@Base 0.0.3 g3d_matrix_multiply@Base 0.0.3 g3d_matrix_rotate@Base 0.0.3 g3d_matrix_rotate_xyz@Base 0.0.3 g3d_matrix_scale@Base 0.0.5 g3d_matrix_translate@Base 0.0.3 g3d_matrix_transpose@Base 0.0.5 g3d_model_center@Base 0.0.3 g3d_model_check@Base 0.0.3 g3d_model_clear@Base 0.0.3 g3d_model_free@Base 0.0.3 g3d_model_get_object_by_name@Base 0.0.5 g3d_model_load@Base 0.0.3 g3d_model_load_full@Base 0.0.6 g3d_model_new@Base 0.0.3 g3d_model_transform@Base 0.0.7 g3d_object_duplicate@Base 0.0.3 g3d_object_free@Base 0.0.3 g3d_object_merge@Base 0.0.3 g3d_object_optimize@Base 0.0.3 g3d_object_radius@Base 0.0.3 g3d_object_scale@Base 0.0.3 g3d_object_smooth@Base 0.0.3 g3d_object_transform@Base 0.0.3 g3d_object_transform_normals@Base 0.0.7 g3d_plugins_cleanup@Base 0.0.3 g3d_plugins_get_filetype@Base 0.0.3 g3d_plugins_get_image_extensions@Base 0.0.3 g3d_plugins_init@Base 0.0.3 g3d_plugins_load_image@Base 0.0.3 g3d_plugins_load_image_from_stream@Base 0.0.7 g3d_plugins_load_model@Base 0.0.3 g3d_plugins_load_model_from_stream@Base 0.0.7 g3d_primitive_box@Base 0.0.7 g3d_primitive_box_strip_2d@Base 0.0.7 g3d_primitive_cube@Base 0.0.5 g3d_primitive_cylinder@Base 0.0.3 g3d_primitive_mesh@Base 0.0.7 g3d_primitive_sphere@Base 0.0.5 g3d_primitive_tube@Base 0.0.3 g3d_quat_add@Base 0.0.7 g3d_quat_normalize@Base 0.0.7 g3d_quat_rotate@Base 0.0.7 g3d_quat_to_matrix@Base 0.0.7 g3d_quat_to_rotation_xyz@Base 0.0.7 g3d_quat_trackball@Base 0.0.7 g3d_read_cstr@Base 0.0.5 g3d_read_double_be@Base 0.0.5 g3d_read_double_le@Base 0.0.5 g3d_read_float_be@Base 0.0.3 g3d_read_float_le@Base 0.0.3 g3d_read_int16_be@Base 0.0.3 g3d_read_int16_le@Base 0.0.3 g3d_read_int32_be@Base 0.0.3 g3d_read_int32_le@Base 0.0.3 g3d_read_int8@Base 0.0.3 g3d_stream_close@Base 0.0.7 g3d_stream_eof@Base 0.0.7 g3d_stream_from_buffer@Base 0.0.7 g3d_stream_get_uri@Base 0.0.7 g3d_stream_is_seekable@Base 0.0.7 g3d_stream_line@Base 0.0.7 g3d_stream_new_custom@Base 0.0.7 g3d_stream_open_file@Base 0.0.7 g3d_stream_open_gzip_from_stream@Base 0.0.7 g3d_stream_open_structured_file@Base 0.0.7 g3d_stream_open_structured_file_from_stream@Base 0.0.7 g3d_stream_open_zip@Base 0.0.7 g3d_stream_open_zip_from_stream@Base 0.0.7 g3d_stream_read@Base 0.0.7 g3d_stream_read_cstr@Base 0.0.7 g3d_stream_read_double_be@Base 0.0.7 g3d_stream_read_double_le@Base 0.0.7 g3d_stream_read_float_be@Base 0.0.7 g3d_stream_read_float_le@Base 0.0.7 g3d_stream_read_int16_be@Base 0.0.7 g3d_stream_read_int16_le@Base 0.0.7 g3d_stream_read_int32_be@Base 0.0.7 g3d_stream_read_int32_le@Base 0.0.7 g3d_stream_read_int8@Base 0.0.7 g3d_stream_read_line@Base 0.0.7 g3d_stream_seek@Base 0.0.7 g3d_stream_size@Base 0.0.7 g3d_stream_skip@Base 0.0.7 g3d_stream_tell@Base 0.0.7 g3d_stream_zlib_inflate_stream@Base 0.0.7 g3d_texture_flip_y@Base 0.0.5 g3d_texture_free@Base 0.0.5 g3d_texture_load@Base 0.0.5 g3d_texture_load_cached@Base 0.0.3 g3d_texture_load_from_stream@Base 0.0.7 g3d_texture_merge_alpha@Base 0.0.5 g3d_texture_prepare@Base 0.0.3 g3d_vector_normal@Base 0.0.3 g3d_vector_transform@Base 0.0.3 g3d_vector_unify@Base 0.0.3 debian/patches/0000775000000000000000000000000012115103734010614 5ustar debian/patches/autoreconf-libtool.patch0000664000000000000000000000136212115103646015450 0ustar Description: Allow libtool to update their files to keep them consistent Author: Sven Eckelmann --- diff --git a/Makefile.am b/Makefile.am index 07057052fa509dd08131f813abf998489723a7e7..b73a5b2befe78c7ed5bed4eece06225c3b5a46ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,4 @@ +ACLOCAL_AMFLAGS = -I m4 SUBDIRS = . doc m4 include src plugins programs tests pkgconfigdir=${libdir}/pkgconfig diff --git a/configure.in b/configure.in index 43312a30d9a355ffa7817c249f94e0a8712c5041..f0170809dd130fd000d1406a967be97ffa42649c 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,7 @@ AC_INIT(configure.in) AC_CONFIG_AUX_DIR(config) +AC_CONFIG_MACRO_DIR([m4]) # versioning stuff m4_define([g3d_major_version], [0]) debian/patches/fix-memory-leaks.patch0000664000000000000000000001100412115103646015024 0ustar Description: Fix memory leaks in plugins Bug: https://mail.gna.org/public/libg3d-devel/2009-02/msg00000.html Author: Sven Eckelmann --- diff --git a/plugins/import/imp_ac3d/imp_ac3d.c b/plugins/import/imp_ac3d/imp_ac3d.c index 3653b07a13868de11777854cdf7f726a3764aad9..46b48002fe7667b4eaa9f1a085daf643d4ccc9ae 100644 --- a/plugins/import/imp_ac3d/imp_ac3d.c +++ b/plugins/import/imp_ac3d/imp_ac3d.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #define AC3D_FLAG_ACC 0x01 @@ -119,6 +120,7 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, g_debug("\\(0) Object (line %d)", rowcnt); ac3d_read_object(stream, context, model, buffer, transform, flags, &(model->objects), &rowcnt, 1); + g_free(transform); } else { @@ -330,8 +332,10 @@ static gint32 ac3d_read_object(G3DStream *stream, G3DContext *context, /* normal face */ for(i = 0; i < face->vertex_count; i ++) { - if(!g3d_stream_read_line(stream, buffer, 2048)) + if(!g3d_stream_read_line(stream, buffer, 2048)) { + g3d_face_free(face); return 0; + } *rowcnt += 1; if(sscanf(buffer, "%u %f %f", @@ -350,16 +354,13 @@ static gint32 ac3d_read_object(G3DStream *stream, G3DContext *context, face->tex_vertex_data[i * 2 + 0] += texoffu; face->tex_vertex_data[i * 2 + 1] += texoffv; - -#if 0 - face->tex_coords[i * 2 + 0] *= texscaleu; - face->tex_coords[i * 2 + 1] *= texscalev; -#endif } if(face->material && (face->vertex_count >= 3)) object->faces = g_slist_prepend(object->faces, face); + else + g3d_face_free(face); } /* not .acc */ else diff --git a/plugins/import/imp_dpm/imp_dpm.c b/plugins/import/imp_dpm/imp_dpm.c index 7f616e8143fa1434601838c351c352a7add23f68..a70450555b1af77406c3ad49049bd53583821d2b 100644 --- a/plugins/import/imp_dpm/imp_dpm.c +++ b/plugins/import/imp_dpm/imp_dpm.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -136,8 +137,13 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, /* read triangles */ /* TODO */ + + g_free(normals); } + /* FIXME: insert object into model instead */ + g3d_object_free(object); + return TRUE; } diff --git a/plugins/import/imp_flt/imp_flt.c b/plugins/import/imp_flt/imp_flt.c index 847b881a4800ad7f6ca9a1b233c41ddf2eaaaf48..4ceee2720e40c8ecfc0292d784534bed07d1435c 100644 --- a/plugins/import/imp_flt/imp_flt.c +++ b/plugins/import/imp_flt/imp_flt.c @@ -64,6 +64,7 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, if(opcode == 0) { /* end of file or error */ + g_free(ld); break; } diff --git a/plugins/import/imp_md3/imp_md3.c b/plugins/import/imp_md3/imp_md3.c index 7bacf5a473937872bf00a1b0d9a5fdfa275d8a80..0f407b30cb6d3a50661f18824e5f31de7ad37353 100644 --- a/plugins/import/imp_md3/imp_md3.c +++ b/plugins/import/imp_md3/imp_md3.c @@ -253,6 +253,7 @@ gboolean md3_read_mesh(G3DStream *stream, G3DContext *context, G3DModel *model) if((nvertex == 0) || (ntris == 0)) { g_warning("MD3: %u vertices, %u triangles", nvertex, ntris); g3d_stream_seek(stream, off_start + mlength, G_SEEK_SET); + g3d_object_free(object); return FALSE; } diff --git a/plugins/import/imp_obj/imp_obj.c b/plugins/import/imp_obj/imp_obj.c index e131afdb362080441fd455d1a0fe2079ffe4c706..466754e7a16bc3441cf19b39a88b0fe1f433b3ae 100644 --- a/plugins/import/imp_obj/imp_obj.c +++ b/plugins/import/imp_obj/imp_obj.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #define OBJ_USE_GROUPING 0 @@ -161,8 +162,10 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, face->vertex_count = num_v - 1; /* next one if # of vertices < 3 */ - if(face->vertex_count < 3) + if(face->vertex_count < 3) { + g3d_face_free(face); continue; + } /* calculate object-local vertex offset, indices * in .obj files are absolute */ @@ -176,6 +179,7 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, #endif if(object == NULL) { g_warning("error: face before object"); + g3d_face_free(face); return FALSE; } debian/patches/load-so-modules.patch0000664000000000000000000000227212115103646014646 0ustar Description: Identify modules by the ending .so instead of .la .la files were stripped of the debs to fulfill the release goal http://wiki.debian.org/ReleaseGoals/LAFileRemoval but the plugin loader of libg3d tries to identify plugins by their libtool archive. Author: Sven Eckelmann --- diff --git a/src/plugins.c b/src/plugins.c index 31624e31e50298a057aafde2f433e322187da951..f8d282ba28519e84cbcab97f38b94634d93c6a72 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -89,7 +89,7 @@ static gboolean plugins_loaddirectory(G3DContext *context, #ifdef G_OS_WIN32 if(g_strcasecmp(filename + strlen(filename) - 4, ".dll") == 0) { #else - if(g_strcasecmp(filename + strlen(filename) - 3, ".la") == 0) { + if(g_strcasecmp(filename + strlen(filename) - 3, ".so") == 0) { #endif plugin = g_new0(G3DPlugin, 1); @@ -214,7 +214,7 @@ static G3DPlugin *plugins_magic_lookup(G3DContext *context, if((type == NULL) || (strlen(type) == 0)) return NULL; - name = g_strdup_printf("imp_%s.la", type); + name = g_strdup_printf("imp_%s.so", type); for(item = context->plugins; item != NULL; item = item->next) { tp = (G3DPlugin *)item->data; if(tp->type != G3D_PLUGIN_IMPORT) debian/patches/fix-memory-leaks-2.patch0000664000000000000000000001301212115103646015164 0ustar Description: Fix memory leaks Forwarded: https://mail.gna.org/public/libg3d-devel/2010-02/msg00000.html Author: Picca Frédéric-Emmanuel Bug-Debian: http://bugs.debian.org/570084 --- diff --git a/plugins/image/img_gdkpixbuf.c b/plugins/image/img_gdkpixbuf.c index 931c9fdf9c19059bc01570985ee29189e5f2fae0..5a4984d8242c49029fa66e2914623582c9d622a4 100644 --- a/plugins/image/img_gdkpixbuf.c +++ b/plugins/image/img_gdkpixbuf.c @@ -108,16 +108,23 @@ gchar **plugin_extensions(G3DContext *context) gchar *extensions = g_strdup(""); gchar **retval; gchar *tmp; + gchar *ext; + gchar **exts; GSList *fitem; + GSList *list; GdkPixbufFormat *format; - fitem = gdk_pixbuf_get_formats(); + list = fitem = gdk_pixbuf_get_formats(); while(fitem) { format = (GdkPixbufFormat *)fitem->data; + exts = gdk_pixbuf_format_get_extensions(format); + ext = g_strjoinv(":", exts); tmp = g_strdup_printf("%s%s%s", extensions, - strlen(extensions) ? ":" : "", - g_strjoinv(":", gdk_pixbuf_format_get_extensions(format))); + strlen(extensions) ? ":" : "", + ext); + g_strfreev(exts); + g_free(ext); g_free(extensions); extensions = tmp; fitem = fitem->next; @@ -125,6 +132,8 @@ gchar **plugin_extensions(G3DContext *context) retval = g_strsplit(extensions, ":", 0); g_free(extensions); + g_slist_free(list); + return retval; } diff --git a/plugins/import/imp_ldraw/imp_ldraw_color.c b/plugins/import/imp_ldraw/imp_ldraw_color.c index 269f6c6d6a418b3a68cb474c8092cac427838d39..7623f5edb8747a2840eeb9df7b4337731b160cd7 100644 --- a/plugins/import/imp_ldraw/imp_ldraw_color.c +++ b/plugins/import/imp_ldraw/imp_ldraw_color.c @@ -103,6 +103,21 @@ gboolean ldraw_color_init(LDrawLibrary *lib) return TRUE; } +void ldraw_color_cleanup(LDrawLibrary *lib) +{ + GSList *plist; + + g_hash_table_destroy(lib->colordb); + + plist = lib->colorlist; + while(plist) + { + g3d_material_free((G3DMaterial *)plist->data); + plist = plist->next; + } + g_slist_free(lib->colorlist); +} + G3DMaterial *ldraw_color_lookup(LDrawLibrary *lib, guint32 colid) { G3DMaterial *material; diff --git a/plugins/import/imp_ldraw/imp_ldraw_color.h b/plugins/import/imp_ldraw/imp_ldraw_color.h index e5844de6c81b6b61fa88e70a07b15c49af1dfff1..941d0c10db6754018df6212f3a67e21903e1f6d5 100644 --- a/plugins/import/imp_ldraw/imp_ldraw_color.h +++ b/plugins/import/imp_ldraw/imp_ldraw_color.h @@ -25,6 +25,7 @@ #include "imp_ldraw_types.h" gboolean ldraw_color_init(LDrawLibrary *lib); +void ldraw_color_cleanup(LDrawLibrary *lib); G3DMaterial *ldraw_color_lookup(LDrawLibrary *lib, guint32 colid); #endif /* _IMP_LDRAW_COLOR_H */ diff --git a/plugins/import/imp_ldraw/imp_ldraw_library.c b/plugins/import/imp_ldraw/imp_ldraw_library.c index aa07cdb52a45e8a7db380a8bba9ae7ffaf96433f..7e12128e7222eadcf16c952cea6ba0109d90b834 100644 --- a/plugins/import/imp_ldraw/imp_ldraw_library.c +++ b/plugins/import/imp_ldraw/imp_ldraw_library.c @@ -114,6 +114,7 @@ void ldraw_library_cleanup(LDrawLibrary *lib) ldraw_part_free(part); } g_hash_table_destroy(lib->partdb); + ldraw_color_cleanup(lib); g_free(lib); } diff --git a/plugins/import/imp_obj/imp_obj.c b/plugins/import/imp_obj/imp_obj.c index 466754e7a16bc3441cf19b39a88b0fe1f433b3ae..6d7fe2f20dc5adccdfccb163e88170800a6d09c2 100644 --- a/plugins/import/imp_obj/imp_obj.c +++ b/plugins/import/imp_obj/imp_obj.c @@ -164,6 +164,7 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, /* next one if # of vertices < 3 */ if(face->vertex_count < 3) { g3d_face_free(face); + g_strfreev(vstrs); continue; } @@ -180,6 +181,7 @@ gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, if(object == NULL) { g_warning("error: face before object"); g3d_face_free(face); + g_strfreev(vstrs); return FALSE; } diff --git a/src/material.c b/src/material.c index ad03d62b8bc355ad213d7404c16328f9625a4f1e..e9f529ee606ae7e4dfeab69546d1ca37a465f4dc 100644 --- a/src/material.c +++ b/src/material.c @@ -36,5 +36,6 @@ G3DMaterial *g3d_material_new(void) void g3d_material_free(G3DMaterial *material) { + g_free(material->name); g_free(material); } diff --git a/src/object.c b/src/object.c index 202fbfa58151eaff1493984b900b822760fa87ae..42afe7cc4f3e34424b3e44fb2516f85107fb581e 100644 --- a/src/object.c +++ b/src/object.c @@ -44,6 +44,7 @@ void g3d_object_free(G3DObject *object) while(slist != NULL) { mat = (G3DMaterial*)slist->data; + g3d_material_free(mat); snext = slist->next; g_slist_free_1(slist); slist = snext; @@ -67,7 +68,8 @@ void g3d_object_free(G3DObject *object) if(object->_indices != NULL) g_free(object->_indices); if(object->_materials != NULL) g_free(object->_materials); if(object->_flags != NULL) g_free(object->_flags); - + if(object->_tex_images != NULL) g_free(object->_tex_images); + if(object->_tex_coords != NULL) g3d_vector_free(object->_tex_coords); g_free(object); } diff --git a/src/plugins.c b/src/plugins.c index f8d282ba28519e84cbcab97f38b94634d93c6a72..044950df7296bd9c470c610df43a98ac1650462b 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -32,13 +32,12 @@ static void plugins_free_plugin(G3DPlugin *plugin) { - if(plugin->name) - g_free(plugin->name); - if(plugin->path) - g_free(plugin->path); - if(plugin->extensions) - g_strfreev(plugin->extensions); + if(!plugin) + return; + g_free(plugin->name); + g_free(plugin->path); + g_strfreev(plugin->extensions); if(plugin->module) g_module_close(plugin->module); debian/patches/fix-memory-leaks-3.patch0000664000000000000000000000106412115103646015171 0ustar Description: Fix memory leaks Forwarded: https://mail.gna.org/public/libg3d-devel/2010-08/msg00000.html Author: Picca Frédéric-Emmanuel Bug-Debian: http://bugs.debian.org/593209 --- diff --git a/src/face.c b/src/face.c index d012f57bd4b9b854871bd75807c467a56f0d9317..f14c941b819c8d70f780b3d42d0b218bf57095ac 100644 --- a/src/face.c +++ b/src/face.c @@ -30,6 +30,8 @@ void g3d_face_free(G3DFace *face) { if(face->vertex_indices) g_free(face->vertex_indices); + if(face->normals) + g_free(face->normals); g_free(face); } debian/patches/pc-glib2-private.patch0000664000000000000000000000127012115103646014706 0ustar Description: Only require glib2.0 for header files Programs linked against libg3d doesn't need to link to glib2.0 when they don't use it directly. Pkg-config allows us to use Require.private in such situations. Author: Sven Eckelmann --- diff --git a/libg3d.pc.in b/libg3d.pc.in index 5c0205b41afc5ef5bf6276d35ddd0b4d02f66163..41849fa26880c0c27c36eb3cf0d30c7fc22bad16 100644 --- a/libg3d.pc.in +++ b/libg3d.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: libg3d Version: @VERSION@ Description: 3D object loading library -Requires: glib-2.0 +Requires.private: glib-2.0 Libs: -L${libdir} -lg3d Libs.private: -lm @MAGIC_LIBS@ @LIBGSF_LIBS@ Cflags: -I${includedir} debian/patches/pkglib_data.patch0000664000000000000000000000075412115103646014106 0ustar Description: Fix build with automake 1.11.3 Author: Sven Eckelmann --- diff --git a/Makefile.am b/Makefile.am index b73a5b2befe78c7ed5bed4eece06225c3b5a46ac..dd8d9513901662c800cb581690e6668684c55aa3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = . doc m4 include src plugins programs tests pkgconfigdir=${libdir}/pkgconfig pkgconfig_DATA = libg3d.pc -pkglib_DATA = libg3d.magic +pkgdata_DATA = libg3d.magic deb: fakeroot dpkg-buildpackage debian/patches/series0000664000000000000000000000037612115103646012041 0ustar fix-memory-leaks.patch endless-seek.patch configure-cxx.patch autoreconf-libtool.patch load-so-modules.patch fix-memory-leaks-2.patch pc-glib2-private.patch fix-memory-leaks-3.patch fix-memory-leaks-dae.patch pkglib_data.patch implicit_declaration.patch debian/patches/implicit_declaration.patch0000664000000000000000000000164212115103646016021 0ustar Description: Fix implicit declarations of functions Author: Sven Eckelmann --- diff --git a/plugins/import/imp_vrml/imp_vrml_v1.c b/plugins/import/imp_vrml/imp_vrml_v1.c index 74c21301f37c2deedb206a023e7c0a3b1f7adb45..895efc7abe04e1dc8cffa044574f73ef9f21ee83 100644 --- a/plugins/import/imp_vrml/imp_vrml_v1.c +++ b/plugins/import/imp_vrml/imp_vrml_v1.c @@ -17,6 +17,7 @@ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ +#define _POSIX_SOURCE 1 #include #include #include diff --git a/src/object.c b/src/object.c index 42afe7cc4f3e34424b3e44fb2516f85107fb581e..485ef8da0a2909e9ba8c48a7ad65cba27cd40c2f 100644 --- a/src/object.c +++ b/src/object.c @@ -29,6 +29,7 @@ #include #include #include +#include void g3d_object_free(G3DObject *object) { debian/patches/fix-memory-leaks-dae.patch0000664000000000000000000000253212115103646015561 0ustar Description: Fix memory leaks in dae plugin Forwarded: https://mail.gna.org/public/libg3d-devel/2010-08/msg00000.html Author: Picca Frédéric-Emmanuel Bug-Debian: http://bugs.debian.org/593209 --- diff --git a/plugins/import/imp_dae/imp_dae_cb.c b/plugins/import/imp_dae/imp_dae_cb.c index 5981fb0cc916036333ba23ae757961a2b6418d8f..eabdda7562aca6c7d1b2419353e90bbea5ab7502 100644 --- a/plugins/import/imp_dae/imp_dae_cb.c +++ b/plugins/import/imp_dae/imp_dae_cb.c @@ -806,6 +806,10 @@ gboolean dae_cb_vertices__input(DaeGlobalData *global, DaeLocalData *local) g_return_val_if_fail(cnt != NULL, FALSE); object->vertex_count = atoi(cnt); + + if(cnt) + g_free(cnt); + g_return_val_if_fail(object->vertex_count != 0, FALSE); object->vertex_data = g_new0(gfloat, 3 * object->vertex_count); diff --git a/plugins/import/imp_dae/imp_dae_library.c b/plugins/import/imp_dae/imp_dae_library.c index dd103513cb46def1a6d160a7a216421584e67266..9312a60dc013532b541cecb78a84686f415246f7 100644 --- a/plugins/import/imp_dae/imp_dae_library.c +++ b/plugins/import/imp_dae/imp_dae_library.c @@ -158,6 +158,7 @@ void dae_library_cleanup(DaeLibrary *library) nodelib = (DaeLibraryNodes *)item->data; g_hash_table_destroy(nodelib->ids); g_slist_free(nodelib->nodes); + g_free(nodelib); } g_hash_table_destroy(library->ids); debian/patches/endless-seek.patch0000664000000000000000000000106112115103646014217 0ustar Description: fix possible endless loop in g3d_stream_seek Origin: upstream, http://svn.gna.org/viewcvs/libg3d/trunk/src/stream.c?rev=426&r1=402&r2=426 Author: Eric Sesterhenn --- diff --git a/src/stream.c b/src/stream.c index 48de709a9084a72dbcf94b7856a26983d283d9e8..75948f3fa0a8c569e7eec0d8b3e4969288f32d7d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -82,7 +82,7 @@ gint g3d_stream_skip(G3DStream *stream, goffset offset) g_free(buffer); return -1; } - offset -= s; + todo -= s; } g_free(buffer); return 0; debian/patches/configure-cxx.patch0000664000000000000000000000063412115103646014423 0ustar Description: Add AC_PROG_CXX for tests/Makefile.am Author: Sven Eckelmann --- diff --git a/configure.in b/configure.in index 4d1f6393abd0b9b202cbc824f773a7270bce4945..43312a30d9a355ffa7817c249f94e0a8712c5041 100644 --- a/configure.in +++ b/configure.in @@ -28,6 +28,7 @@ AC_SUBST(LTVERSION) AC_CONFIG_HEADERS(include/g3d/config.h) AC_PROG_CC +AC_PROG_CXX AM_PROG_LEX AC_HEADER_STDC debian/watch0000664000000000000000000000015512115103646010221 0ustar version=3 opts="uversionmangle=s/-(alpha|beta|rc)/~$1/" \ http://download.gna.org/libg3d/libg3d-(.*).tar.gz debian/control0000664000000000000000000001012212115103664010566 0ustar Source: libg3d Section: libs Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Sven Eckelmann Dm-Upload-Allowed: yes Standards-Version: 3.9.3 Homepage: http://automagically.de/g3dviewer/ Vcs-Git: git://anonscm.debian.org/collab-maint/libg3d.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libg3d.git Build-Depends: automake, debhelper (>= 9), dh-autoreconf (>= 4), dpkg-dev (>= 1.16.1.1), flex, gtk-doc-tools, libglib2.0-dev, libgsf-1-dev | libgsf-gnome-1-dev, libgtk2.0-dev, libtool, libxml2-dev, libz-dev, pkg-config, Build-Conflicts: autoconf2.13, automake1.4, XS-Testsuite: autopkgtest Package: libg3d0 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, ${shlibs:Depends}, Recommends: libg3d-plugins, Suggests: libg3d-doc, libg3d-plugin-gdkpixbuf, Description: library for loading and manipulating 3D model files LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . LibG3D cannot load anything without the importers provided by libg3d-plugins and libg3d-plugin-gdkpixbuf. See these packages for more information about supported formats. Package: libg3d-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libg3d0 (= ${binary:Version}), libglib2.0-dev, Recommends: pkg-config, Suggests: libgsf-1-dev | libgsf-gnome-1-dev, Description: LibG3D development package LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . This package contains everything which is needed to link against libg3d0. Package: libg3d-dbg Section: debug Priority: extra Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, libg3d0 (= ${binary:Version}) | libg3d-plugins (= ${binary:Version}) | libg3d-plugin-gdkpixbuf (= ${binary:Version}), Description: LibG3D debug symbols package LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . This package contains the debug files. Package: libg3d-doc Section: doc Architecture: all Depends: ${misc:Depends}, Description: LibG3D API documentation in HTML format LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . This package contains the API documentation of the LibG3D library in HTML format. Package: libg3d-plugins Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, ${shlibs:Depends}, libg3d0 (= ${binary:Version}), Description: plugins for the LibG3D library LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . This package contains plugins for the LibG3D library, so that files can be loaded. It can handle: * 3D Studio (.3ds, .prj) * LightWave (.lw, .lwb, .lwo) * Alias Wavefront (.obj) * Impulse TurboSilver / Imagine (.iob) * AutoCAD (.dxf) * Quake II Models (.md2) * Quake III Models (.md3) * Neutral File Format (.nff) * 3D Metafile (.3dmf, .3mf, .b3d) * Caligari TrueSpace Objects (.cob) * Quick3D Objects & Scenes (.q3o, q3s) * VRML 1.0 files (.wrl, .vrml) * AC3D objects (.ac, .acc) * LeoCAD Models (.lcd) * Racer car models (.ar, .dof) * Ultimate Stunts car models (.glb) * VDrift car models (.joe, .car) * COLLADA (.dae) * Keyhole Markup Language model container (.kmz) * ASCII Scene Exporter (.ase) * LDraw (.dat, .mpd) Package: libg3d-plugin-gdkpixbuf Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, ${shlibs:Depends}, libg3d0 (= ${binary:Version}), Description: plugin for the LibG3D library LibG3D is a framework for loading 3d model files from files or memory. It can also load associated data like textures. . This package contains a plugin for the LibG3D library so that LibG3D can load every image that libgdk-pixbuf2 is able to work with. debian/rules0000775000000000000000000000330012115103646010243 0ustar #!/usr/bin/make -f # -*- makefile -*- export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DBG_PACKAGE=$(shell dpkg-parsechangelog|grep '^Source: '|sed 's/^Source:\s*//')-dbg BUILDROOT=build binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep: dh $@ --parallel --list-missing get-orig-source: uscan --verbose --force-download override_dh_auto_configure: set -e ;\ test -d "$(CURDIR)/$(BUILDROOT)" || \ ( mkdir -p "$(CURDIR)/$(BUILDROOT)" ;\ for f in "$(CURDIR)"/*; do cp -arf "$$f" "$(CURDIR)/$(BUILDROOT)/" || true; done ;\ cd "$(CURDIR)/$(BUILDROOT)" ;\ gtkdocize --copy ;\ autoreconf -fi -I m4 ;\ dh_autoreconf --as-needed ;\ dh_auto_configure -- --enable-gtk-doc --libexecdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)/libg3d' --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)/' --disable-libmagic ) override_dh_auto_clean: rm -rf "$(CURDIR)/$(BUILDROOT)" override_dh_auto_build: cd "$(CURDIR)/$(BUILDROOT)" && dh_auto_build override_dh_auto_install: cd "$(CURDIR)/$(BUILDROOT)" && dh_auto_install --destdir="$(CURDIR)/debian/tmp/" override_dh_strip: dh_strip -a --dbg-package="$(DBG_PACKAGE)" override_dh_installdocs: dh_installdocs -A AUTHORS README TODO override_dh_auto_test: # do nothing to fix dh_auto_test thinks that tests is test target .PHONY: binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep \ get-orig-source override_dh_auto_configure override_dh_auto_clean override_dh_auto_build override_dh_auto_install override_dh_strip override_dh_installdocs override_dh_auto_test debian/libg3d-plugins.install0000664000000000000000000000024312115103646013401 0ustar usr/lib/*/libg3d/plugins/image/img_bmp.so usr/lib/*/libg3d/plugins/image/img_dds.so usr/lib/*/libg3d/plugins/image/img_sgi.so usr/lib/*/libg3d/plugins/import/*.so debian/libg3d-dev.install0000664000000000000000000000010612115103646012474 0ustar usr/include/g3d/*.h usr/lib/*/pkgconfig/libg3d.pc usr/lib/*/libg3d.so debian/libg3d-plugin-gdkpixbuf.install0000664000000000000000000000006012115103646015174 0ustar usr/lib/*/libg3d/plugins/image/img_gdkpixbuf.so