Commit Graph

13 Commits

Author SHA1 Message Date
Ell
25ed35af62 app: accept a const GimpTempBuf in more temp-buf functions
In gimp_temp_buf_{ref,unref}(), and
gimp_temp_buf_create_{buffer,pixmap}(), accept a const GimpTempBuf
argument.

(cherry picked from commit 0a1e62768a)
2019-02-24 13:22:28 -05:00
Ell
a5130c7f66 app: add temp-buf-total varaible to the dashboard
Add a temp-buf-total variable to the dashboard's misc group,
showing the total size of all GimpTempBuf objects.

(cherry picked from commit bb645bae17)
2019-02-22 08:47:13 -05:00
Ell
8f31f8fa3c app: add gimp_temp_buf_{lock,unlock}()
In GimpTempBuf, add gimp_temp_buf_lock() and gimp_temp_buf_unlock()
functions, which lock/unlock the buffer for data access.  Unlike
gimp_temp_buf_get_data(), which returns a direct pointer to the
buffer's data, the new functions take a format parameter and may
return a temporary buffer, allowing the buffer to be accessed using
an arbitrary format.

(cherry picked from commit 12dde445c4)
2019-02-06 14:30:55 -05:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
f98d1b3a76 Bug 789613 - core: Fix integer overflow on 64 bit systems
The C language only promotes data values up to (un)signed int,
which is 32 bit, if no larger data type is used within the
calculation. Having a multiplication of two gint variables,
even if the expected target variable is of type gsize (64 bit),
leads to a possible integer overflow.

This bug can be triggered in gimp_temp_buf_new, which is used
to allocate memory for given supplied dimensions and bytes per
pixel. If triggered, less memory than needed is allocated and
therefore allows out of boundary accesses, either resulting in
possible code execution or information leakage.

While at it, make sure that the supplied format can actually be
resolved to a bytes per pixel value. If not, return NULL.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2018-01-01 17:10:01 +01:00
a7cd595241 app: fix crashing typo in previous commit 2014-02-23 01:28:34 +01:00
9498cc615d Bug 722676: Pasting image from clipboard sometimes does not work.
Change gimp_pixbuf_create_buffer() to copy the pixels if a linear
buffer cannot be created. Add functions that convert between
GimpTempBuf and GdkPixbuf. Fix users of gimp_pixbuf_create_buffer()
to make the least possible copies. Patch modified by Mitch.
2014-02-23 00:49:56 +01:00
ff9c91ce6f Use gegl_malloc in GimpTempBuf
Which allocates 16 byte aligned memory for SSE code.
2013-06-25 20:40:27 -07:00
1bbd3d40a8 app: make the GimpTempBuf struct private and add accessors 2012-05-02 17:51:12 +02:00
685a48d59a app: move gimp_gegl_buffer_get_temp_buf() to gimptempbuf.[ch] 2012-05-02 17:51:02 +02:00
324f594fa9 app: remove "x" and "y" members from GimpTempBuf
and generally clean up things a bit.
2012-05-02 17:51:02 +02:00
631134180e app: swallow gimp_temp_buf_demultiply() into gimp_image_get_new_preview() 2012-05-02 17:51:01 +02:00
bdf6b48138 app: move GimpTempBuf from base/ to core/
and forget about include policy in base/, it's scheduled for removal
anyway.
2012-05-02 17:51:01 +02:00