summaryrefslogtreecommitdiff
path: root/apps/graphics
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-23 02:24:15 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-23 02:24:15 +0000
commitf0634683c5ac92acf1d92b80bffb17cfabc57fd4 (patch)
tree9014d49eabfa1264b6c40bd89fdad3df898c2a74 /apps/graphics
parent29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b (diff)
downloadnuttx-f0634683c5ac92acf1d92b80bffb17cfabc57fd4.tar.gz
nuttx-f0634683c5ac92acf1d92b80bffb17cfabc57fd4.tar.bz2
nuttx-f0634683c5ac92acf1d92b80bffb17cfabc57fd4.zip
Correct a couple of TIFF bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3972 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/graphics')
-rw-r--r--apps/graphics/tiff/tiff_finalize.c5
-rw-r--r--apps/graphics/tiff/tiff_initialize.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/apps/graphics/tiff/tiff_finalize.c b/apps/graphics/tiff/tiff_finalize.c
index 9526121a5..5c1cbefe5 100644
--- a/apps/graphics/tiff/tiff_finalize.c
+++ b/apps/graphics/tiff/tiff_finalize.c
@@ -270,7 +270,8 @@ int tiff_finalize(FAR struct tiff_info_s *info)
}
/* Now read strip offset data from tmpfile1, update the offsets, and write
- * the updated offsets to the outfile.
+ * the updated offsets to the outfile. The strip data will begin at offset
+ * outsize + tmp1size;
*/
maxoffsets = info->iosize >> 2;
@@ -309,7 +310,7 @@ int tiff_finalize(FAR struct tiff_info_s *info)
j++, ptr += 4)
{
uint32_t stripoff = tiff_get32(ptr);
- stripoff += info->outsize;
+ stripoff += (info->outsize + info->tmp1size);
tiff_put32(ptr, stripoff);
}
diff --git a/apps/graphics/tiff/tiff_initialize.c b/apps/graphics/tiff/tiff_initialize.c
index b7eb3bd41..67235cb31 100644
--- a/apps/graphics/tiff/tiff_initialize.c
+++ b/apps/graphics/tiff/tiff_initialize.c
@@ -61,7 +61,7 @@
* 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
- * IFD: 10 Number of Directory Entries 12
+ * IFD: 10 Number of Directory Entries 13
* 12 NewSubfileType
* 24 ImageWidth Number of columns is a user parameter
* 36 ImageLength Number of rows is a user parameter
@@ -91,7 +91,7 @@
#define TIFF_IFD_OFFSET (SIZEOF_TIFF_HEADER+2)
-#define TIFF_BILEV_NIFDENTRIES 12
+#define TIFF_BILEV_NIFDENTRIES 13
#define TIFF_BILEV_STRIPIFDOFFS 72
#define TIFF_BILEV_STRIPBCIFDOFFS 96
#define TIFF_BILEV_VALOFFSET 172
@@ -113,7 +113,7 @@
* 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
- * IFD: 10 Number of Directory Entries 13
+ * IFD: 10 Number of Directory Entries 14
* 12 NewSubfileType
* 24 ImageWidth Number of columns is a user parameter
* 36 ImageLength Number of rows is a user parameter
@@ -142,7 +142,7 @@
* xxx Data for strips Beginning of strip data
*/
-#define TIFF_GREY_NIFDENTRIES 13
+#define TIFF_GREY_NIFDENTRIES 14
#define TIFF_GREY_STRIPIFDOFFS 84
#define TIFF_GREY_STRIPBCIFDOFFS 108
#define TIFF_GREY_VALOFFSET 184
@@ -159,7 +159,7 @@
* 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
- * IFD: 10 Number of Directory Entries 14
+ * IFD: 10 Number of Directory Entries 15
* 12 NewSubfileType
* 24 ImageWidth Number of columns is a user parameter
* 36 ImageLength Number of rows is a user parameter
@@ -191,7 +191,7 @@
* xxx Data for strips Beginning of strip data
*/
-#define TIFF_RGB_NIFDENTRIES 13
+#define TIFF_RGB_NIFDENTRIES 15
#define TIFF_RGB_STRIPIFDOFFS 84
#define TIFF_RGB_STRIPBCIFDOFFS 120
#define TIFF_RGB_VALOFFSET 196