[Bf-blender-cvs] [0056f0a] temp_imbuf_types_refactor: Bring back missing IMAGIC magic number for header

Antony Riakiotakis noreply at git.blender.org
Mon Jul 13 12:43:48 CEST 2015


Commit: 0056f0a5bee9f5023196fd8b87a56acddc569d47
Author: Antony Riakiotakis
Date:   Mon Jul 13 12:37:52 2015 +0200
Branches: temp_imbuf_types_refactor
https://developer.blender.org/rB0056f0a5bee9f5023196fd8b87a56acddc569d47

Bring back missing IMAGIC magic number for header

This is the kind of issue that makes this patch necessary,
magic number was used as format type.

===================================================================

M	source/blender/imbuf/intern/iris.c

===================================================================

diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index 0eef8c0..0f7ca80 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -45,6 +45,8 @@
 #include "IMB_colormanagement.h"
 #include "IMB_colormanagement_intern.h"
 
+#define IMAGIC 0732
+
 typedef struct {
 	unsigned short  imagic;      /* stuff saved on disk . . */
 	unsigned short  type;
@@ -247,7 +249,7 @@ static void test_endian_zbuf(struct ImBuf *ibuf)
 
 int imb_is_a_iris(const unsigned char *mem)
 {
-	return ((GS(mem) == IB_FTYPE_IMAGIC) || (GSS(mem) == IB_FTYPE_IMAGIC));
+	return ((GS(mem) == IMAGIC) || (GSS(mem) == IMAGIC));
 }
 
 /*
@@ -281,7 +283,7 @@ struct ImBuf *imb_loadiris(const unsigned char *mem, size_t size, int flags, cha
 	/*printf("new iris\n");*/
 	
 	readheader(inf, &image);
-	if (image.imagic != IB_FTYPE_IMAGIC) {
+	if (image.imagic != IMAGIC) {
 		fprintf(stderr, "longimagedata: bad magic number in image file\n");
 		return(NULL);
 	}




More information about the Bf-blender-cvs mailing list