gtk+ r21643 - trunk/gdk-pixbuf



Author: matthiasc
Date: Mon Oct 13 14:18:40 2008
New Revision: 21643
URL: http://svn.gnome.org/viewvc/gtk+?rev=21643&view=rev

Log:
2008-10-13  Matthias Clasen  <mclasen redhat com>

        Bug 555791 â Natuilus Crashes when opening USB MP3 Player Contents

        * io-tga.c (gdk_pixbuf__tga_stop_load): Don't segfault on
        short files.
        Problem reported by Pedro Villavicencio



Modified:
   trunk/gdk-pixbuf/ChangeLog
   trunk/gdk-pixbuf/io-tga.c

Modified: trunk/gdk-pixbuf/io-tga.c
==============================================================================
--- trunk/gdk-pixbuf/io-tga.c	(original)
+++ trunk/gdk-pixbuf/io-tga.c	Mon Oct 13 14:18:40 2008
@@ -349,7 +349,7 @@
 	}
 
 	ctx->pbuf_bytes = ctx->pbuf->rowstride * ctx->pbuf->height;
-	if (ctx->hdr->flags & TGA_ORIGIN_UPPER || ctx->run_length_encoded)
+	if ((ctx->hdr->flags & TGA_ORIGIN_UPPER) || ctx->run_length_encoded)
 		ctx->pptr = ctx->pbuf->pixels;
 	else
 		ctx->pptr = ctx->pbuf->pixels + (ctx->pbuf->height - 1)*ctx->pbuf->rowstride;
@@ -935,8 +935,10 @@
 	TGAContext *ctx = (TGAContext *) data;
 	g_return_val_if_fail(ctx != NULL, FALSE);
 
-	if (!(ctx->hdr->flags & TGA_ORIGIN_UPPER) && 
-            ctx->run_length_encoded && ctx->pbuf) {
+	if (ctx->hdr &&
+            (ctx->hdr->flags & TGA_ORIGIN_UPPER) == 0 && 
+            ctx->run_length_encoded && 
+            ctx->pbuf) {
 		pixbuf_flip_vertically (ctx->pbuf);
 		if (ctx->ufunc)
 			(*ctx->ufunc) (ctx->pbuf, 0, 0,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]