Skip to content

Commit

Permalink
fixed inadequate validation of SubjectDistance (#2212)
Browse files Browse the repository at this point in the history
  • Loading branch information
warmerdam committed Jun 14, 2010
1 parent 9eab3e3 commit 3554ded
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
2010-06-13 Frank Warmerdam <warmerdam@pobox.com>

* libtiff/tif_dirread.c: Fixed inadequate validation of the
SubjectDistance field (#2212).

* tiff2pdf.c: Fix assorted bugs in tiff2pdf: missing "return"
in t2p_read_tiff_size() causes t2p->tiff_datasize to be set entirely
wrong for COMPRESSION_JPEG case, resulting in memory stomp if actual
Expand Down
9 changes: 8 additions & 1 deletion libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.92.2.7 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_dirread.c,v 1.92.2.8 2010-06-14 00:19:22 fwarmerdam Exp $ */

/*
* Copyright (c) 1988-1997 Sam Leffler
Expand Down Expand Up @@ -1919,6 +1919,13 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
float v;
int ok = 0;

if( dir->tdir_count != 1 || dir->tdir_type != TIFF_RATIONAL )
{
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
"incorrect count or type for SubjectDistance, tag ignored" );
return (0);
}

if (TIFFFetchData(tif, dir, (char *)l)
&& cvtRational(tif, dir, l[0], l[1], &v)) {
/*
Expand Down

0 comments on commit 3554ded

Please sign in to comment.