mesa/src/mapi/glapi/gen
Carl Worth c35f14f368 Eliminate several cases of multiplication in arguments to calloc
In commit 32f2fd1c5d, several calls to
_mesa_calloc(x) were replaced with calls to calloc(1, x). This is strictly
equivalent to what the code was doing previously.

But for cases where "x" involves multiplication, now that we are explicitly
using the two-argument calloc, we can do one step better and replace:

	calloc(1, A * B);

with:

	calloc(A, B);

The advantage of the latter is that calloc will detect any overflow that would
have resulted from the multiplication and will fail the allocation, (whereas
the former would return a small allocation). So this fix can change
potentially exploitable buffer overruns into segmentation faults.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 18:37:02 -07:00
..
AMD_draw_buffers_blend.xml glapi: add functions for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
AMD_performance_monitor.xml mesa: Add core support for the GL_AMD_performance_monitor extension. 2013-09-26 16:55:18 -07:00
APPLE_object_purgeable.xml glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
APPLE_vertex_array_object.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_base_instance.xml glapi: Annotate XML with exec="dynamic" for dynamic functions. 2012-11-06 12:57:41 -08:00
ARB_blend_func_extended.xml glapi: ARB_blend_func_extended support + regen. (v2) 2012-03-26 18:42:41 +01:00
ARB_clear_buffer_object.xml mesa: Add infrastructure for GL_ARB_clear_buffer_object 2013-12-18 09:06:51 -07:00
ARB_clear_texture.xml mesa/main: add ARB_clear_texture entrypoints 2014-07-23 11:50:37 +01:00
ARB_color_buffer_float.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_compressed_texture_pixel_storage.xml glapi: Add XML infrastructure for ARB_compressed_texture_pixel_storage 2014-06-10 07:38:38 +12:00
ARB_compute_shader.xml mesa/cs: Add dispatch API stubs for ARB_compute_shader. 2014-02-05 09:00:14 -08:00
ARB_copy_buffer.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_copy_image.xml mesa: Add GL API support for ARB_copy_image 2014-08-11 11:20:23 -07:00
ARB_debug_output.xml mesa: make ARB_debug_output functions an alias of 2014-03-08 15:38:31 +11:00
ARB_depth_buffer_float.xml glapi: add GL_ARB_depth_buffer_float 2012-03-26 21:35:04 +00:00
ARB_depth_clamp.xml glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
ARB_draw_buffers.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_draw_buffers_blend.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_draw_elements_base_vertex.xml glapi: Annotate XML with exec="dynamic" for dynamic functions. 2012-11-06 12:57:41 -08:00
ARB_draw_indirect.xml glapi: add plumbing for GL_ARB_draw_indirect and GL_ARB_multi_draw_indirect 2013-11-25 22:01:35 +13:00
ARB_draw_instanced.xml glapi: Annotate XML with exec="dynamic" for dynamic functions. 2012-11-06 12:57:41 -08:00
ARB_ES2_compatibility.xml glapi: Add es1 and es2 attributes to XML. 2012-10-16 12:03:55 -07:00
ARB_ES3_compatibility.xml glapi: Add enums for ARB_ES3_compatibility 2013-01-10 10:57:50 -08:00
ARB_framebuffer_object.xml mesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently 2013-07-18 17:42:46 -07:00
ARB_geometry_shader4.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_get_program_binary.xml glapi: Emit dispatch for {ARB,OES}_get_program_binary 2013-01-11 18:13:53 -08:00
ARB_gpu_shader5.xml glapi: add definitions for ARB_gpu_shader5 2014-02-06 16:58:33 -08:00
ARB_instanced_arrays.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_internalformat_query.xml mesa: Add dispatch and extension XML for GL_ARB_internalformat_query 2013-01-15 21:34:45 -08:00
ARB_invalidate_subdata.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_map_buffer_range.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_multi_bind.xml glapi: Add infrastructure for ARB_multi_bind 2014-05-02 02:53:25 +02:00
ARB_robustness.xml mesa: s/GLhandleARB/GLuint/ for glGetUniform functions 2014-03-10 17:06:57 -06:00
ARB_sample_shading.xml mesa: Add new functions and enums required by GL_ARB_sample_shading 2013-11-01 16:01:47 -07:00
ARB_sampler_objects.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_seamless_cube_map.xml glapi: Fix incorrect enum value. 2012-02-23 09:35:44 -08:00
ARB_separate_shader_objects.xml glapi: Mark all GL_ARB_separate_shader_objects functions with static_dispatch=false 2014-03-31 14:46:32 -07:00
ARB_shader_atomic_counters.xml glapi: Add support for ARB_shader_atomic_counters. 2013-10-29 12:40:55 -07:00
ARB_shader_image_load_store.xml glapi: Update dispatch XML files for ARB_shader_image_load_store. 2014-01-15 16:42:08 +01:00
ARB_sync.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_texture_barrier.xml mesa: add ARB_texture_barrier support 2014-08-14 20:25:32 -04:00
ARB_texture_buffer_object.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_texture_buffer_range.xml mesa: implement GL_ARB_texture_buffer_range 2013-01-30 13:10:10 +01:00
ARB_texture_compression_rgtc.xml glapi: add GL_ARB_texture_compression_rgtc 2012-03-26 21:28:25 +00:00
ARB_texture_cube_map_array.xml glapi: add ARB_texture_cube_map_array. 2012-11-09 09:24:41 +10:00
ARB_texture_float.xml glapi: add GL_ARB_texture_float 2012-03-26 21:35:17 +00:00
ARB_texture_gather.xml mesa: fix make check for ARB_texture_gather 2013-10-03 21:38:48 +13:00
ARB_texture_multisample.xml mesa: change glTexImage[23]DMultisample() internalformat to GLenum 2013-10-16 08:43:23 -06:00
ARB_texture_rg.xml glapi: add ARB_texture_rg 2012-03-26 21:28:25 +00:00
ARB_texture_rgb10_a2ui.xml glapi: add ARB_texture_rgb10_a2ui support. 2011-11-27 16:25:12 +00:00
ARB_texture_storage.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_texture_storage_multisample.xml glapi: fix storage multisample build errors 2013-03-31 20:41:28 +10:00
ARB_texture_view.xml mesa: Add API definitions for ARB_texture_view 2013-12-13 12:31:53 -07:00
ARB_uniform_buffer_object.xml glapi: Add es2="3.0" attributes to XML. 2012-10-16 19:31:22 -07:00
ARB_vertex_array_object.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
ARB_vertex_attrib_binding.xml mesa: implement GL_MAX_VERTEX_ATTRIB_STRIDE 2014-08-27 20:35:56 -10:00
ARB_vertex_type_2_10_10_10_rev.xml glapi: Annotate XML with exec="dynamic" for dynamic functions. 2012-11-06 12:57:41 -08:00
ARB_viewport_array.xml mesa: Add ARB_viewport_array plumbing 2014-01-20 11:32:00 -08:00
es_EXT.xml glapi: Add static dispatch for glPointSizePointerOES 2014-04-02 11:30:52 -07:00
EXT_draw_buffers2.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
EXT_framebuffer_object.xml mesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctly 2013-08-06 10:46:05 -07:00
EXT_gpu_shader4.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
EXT_packed_depth_stencil.xml glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
EXT_provoking_vertex.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
EXT_separate_shader_objects.xml mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES 2014-05-02 07:20:10 -07:00
EXT_texture_array.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
EXT_texture_integer.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
EXT_transform_feedback.xml mesa: update glext.h to version 20130708 2013-07-12 08:32:51 -06:00
extension_helper.py glapi: Reformat python code generation scripts to use 4-space indentation. 2012-10-10 11:19:14 -07:00
GL3x.xml mesa: implement glFramebufferTexture 2013-05-01 16:18:25 -07:00
GL4x.xml glapi: add indexed blend functions (GL 4.0) 2014-07-28 16:26:27 -07:00
gl_and_es_API.xml Revert "Revert "glapi/es1: Don't mark core functions as static_dispatch=false"" 2014-04-02 11:30:49 -07:00
gl_and_glX_API.xml glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
gl_API.dtd glapi: Remove handling of mesa_name XML attribute. 2012-11-12 10:53:57 -08:00
gl_API.xml glapi: add GL_ARB_conditional_render_inverted 2014-08-19 08:54:35 -04:00
gl_apitemp.py dispatch: properly handle parameter name mismatches in glapitemp.h. 2012-11-01 11:22:49 -07:00
gl_enums.py glapi: Move declaration before code. 2013-09-23 14:14:32 -07:00
gl_genexec.py mesa: Add GL API support for ARB_copy_image 2014-08-11 11:20:23 -07:00
gl_gentable.py Eliminate several cases of multiplication in arguments to calloc 2014-09-03 18:37:02 -07:00
gl_offsets.py glapi: Reformat python code generation scripts to use 4-space indentation. 2012-10-10 11:19:14 -07:00
gl_procs.py glapi: Remove support for "short string" mode 2014-04-02 11:30:37 -07:00
gl_SPARC_asm.py glapi: Reformat python code generation scripts to use 4-space indentation. 2012-10-10 11:19:14 -07:00
gl_table.py glapi: no longer emit #include "mfeatures.h" in generated files 2013-04-17 17:33:40 -06:00
gl_x86-64_asm.py linux: Don't emit a .note.ABI-tag section anymore (#26663) 2013-04-25 15:51:35 -04:00
gl_x86_asm.py linux: Don't emit a .note.ABI-tag section anymore (#26663) 2013-04-25 15:51:35 -04:00
gl_XML.py mapi/glapi: Use ElementTree instead of libxml2. 2014-03-26 13:51:32 +00:00
glapi_gen.mk automake: use MKDIR_P when possible 2014-03-11 12:50:41 +00:00
glX_API.xml glapi: Mark GLX extensions as window_system="glX". 2012-11-06 12:57:40 -08:00
glX_proto_common.py mapi/glapi: Use ElementTree instead of libxml2. 2014-03-26 13:51:32 +00:00
glX_proto_recv.py mesa: remove empty glthread.h file 2014-03-03 13:08:59 -07:00
glX_proto_send.py Fix build of appleglx 2014-05-23 15:24:07 +01:00
glX_proto_size.py glapi: use new-style Python classes. 2012-10-16 12:03:55 -07:00
glX_server_table.py glapi: Reformat python code generation scripts to use 4-space indentation. 2012-10-10 11:19:14 -07:00
glX_XML.py mapi/glapi: Use ElementTree instead of libxml2. 2014-03-26 13:51:32 +00:00
INTEL_performance_query.xml mesa: Add core support for the GL_INTEL_performance_query extension. 2014-05-02 10:07:04 -07:00
KHR_debug.xml glapi: Add KHR_debug.xml 2014-03-08 15:45:26 +11:00
license.py glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
Makefile.am mesa: add ARB_texture_barrier support 2014-08-14 20:25:32 -04:00
mesadef.py mesa: Remove GL_MESA_resize_buffers 2013-06-28 13:35:21 -07:00
next_available_offset.sh glapi: Move to src/mapi/. 2010-05-07 10:41:11 +08:00
NV_conditional_render.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
NV_primitive_restart.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
NV_texture_barrier.xml mesa: add NV_texture_barrier 2011-03-15 15:47:27 +01:00
NV_vdpau_interop.xml NV_vdpau_interop: fix IsSurfaceNV return type 2014-03-03 18:37:59 +01:00
OES_EGL_image.xml glapi: Add es1 and es2 attributes to XML. 2012-10-16 12:03:55 -07:00
OES_fixed_point.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
OES_single_precision.xml mesa: Standardize names of OpenGL functions. 2012-11-12 10:53:57 -08:00
remap_helper.py glapi: Use GLES information from XML rather than gles_api.py. 2012-10-16 12:03:55 -07:00
SConscript glapi: Fix scons build 2014-04-03 12:52:09 +01:00
typeexpr.py glapi: use new-style Python classes. 2012-10-16 12:03:55 -07:00