hitoshura25/cvefixes huggingface dataset:
CVE-2019-15140 (C, published 2019-08-18T19:15Z)
Description: value: coders/mat.c in ImageMagick 7.0.8-43 Q16 allows remote attackers to cause a denial of service (use-after-free and application crash) or possibly have unspecified other impact by crafting a Matlab image file that is mishandled in ReadImage in MagickCore/constitute.c.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: CWE-416 \u2014 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/mat.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1554


Vulnerable code:
  while(!EOFBlob(image)) /* object parser loop */
    if (filepos != (unsigned int) filepos)
    if((MagickSizeType) (MATLAB_HDR.ObjectSize+filepos) > GetBlobSize(image))

Fixed code:
    if(EOFBlob(image)) break;
  while(filepos < GetBlobSize(image) && !EOFBlob(image)) /* object parser loop */
    if(filepos > GetBlobSize(image) || filepos < 0)
    if((MagickSizeType) (MATLAB_HDR.ObjectSize+filepos) >= GetBlobSize(image))
            ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
CVE-2019-17541 (Other, published 2019-10-14T02:15Z)
Description: value: ImageMagick before 7.0.8-55 has a use-after-free in DestroyStringInfo in MagickCore/string.c because the error manager is mishandled in coders/jpeg.c.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: CWE-416 \u2014 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
ChangeLog
coders/jpeg.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1641


Vulnerable code:
   * resolve division by zero  (reference
   * introducing MagickLevelImageColors() MagickWand method.
	  magnify:method=method, choose from these methods: eagle2X, eagle3X,
2016-01-30  7.0.0-0 	Fahad-Alsaidi & ShamsaHamed
  error_manager->profile=NULL;
  /* The IPTC profile is actually an 8bim */

Fixed code:
2019-07-18  7.0.8-55 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-55, GIT revision 15...

2019-07-18  7.0.8-55 Cristy  <quetzlzacatenango@image...>
  * Heap-buffer overflow (reference
    https://github.com/ImageMagick/ImageMagick/issues/1641

  * resolve division by zero  (reference
  * introducing MagickLevelImageColors() MagickWand method.
    magnify:method=method, choose from these methods: eagle2X, eagle3X,
2016-01-30  7.0.0-0 Fahad-Alsaidi & ShamsaHamed
  error_manager->profile=NULL;
  /*
    The IPTC profile is actually an 8bim.
  */
CVE-2019-17547 (C, published 2019-10-14T02:15Z)
Description: value: In ImageMagick before 7.0.8-62, TraceBezier in MagickCore/draw.c has a use-after-free.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: CWE-416 \u2014 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
MagickCore/draw.c
Commit message: ...


Vulnerable code:
  quantum=MagickMin(quantum/number_coordinates,BezierQuantum);

Fixed code:
  quantum=MagickMin(quantum/number_coordinates,BezierQuantum);
  primitive_info=(*mvg_info->primitive_info)+mvg_info->offset;
CVE-2019-18853 (C, published 2019-11-11T15:15Z)
Description: value: ImageMagick before 7.0.9-0 allows remote attackers to cause a denial of service because XML_PARSE_HUGE is not properly restricted in coders/svg.c, related to SVG and libxml2.
Severity: MEDIUM (CVSS v3 base score: 6.5)
Weakness: CWE-674 \u2014 Uncontrolled Recursion
The product does not properly control the amount of recursion that takes place,  consuming excessive resources, such as allocated memory or the program stack.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/svg.c
Commit message: [FG-VD-19-136] ImageMagick Convert SVG MacOS Denial Of Service


Vulnerable code:
#include "MagickCore/quantum-private.h"
      (void) xmlCtxtUseOptions(svg_info->parser,XML_PARSE_HUGE);

Fixed code:
#include "MagickCore/option.h"
#include "MagickCore/quantum-private.h"
      const char
        *value;

      value=GetImageOption(image_info,"svg:xml-parse-huge");
      if ((value != (char *) NULL) && (IsStringTrue(value) != MagickFalse))
        (void) xmlCtxtUseOptions(svg_info->parser,XML_PARSE_HUGE);
CVE-2019-7175 (C, published 2019-03-07T23:29Z)
Description: value: In ImageMagick before 7.0.8-25, some memory leaks exist in DecodeImage in coders/pcd.c.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-401 \u2014 Missing Release of Memory after Effective Lifetime
The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/pcd.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1450


Vulnerable code:

Fixed code:
        for (j=0; j < i; j++)
          pcd_table[j]=(PCDTable *) RelinquishMagickMemory(pcd_table[j]);
          for (j=0; j <= i; j++)
            pcd_table[j]=(PCDTable *) RelinquishMagickMemory(pcd_table[j]);
CVE-2019-7395 (C, published 2019-02-05T00:29Z)
Description: value: In ImageMagick before 7.0.8-25, a memory leak exists in WritePSDChannel in coders/psd.c.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-401 \u2014 Missing Release of Memory after Effective Lifetime
The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/psd.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1451


Vulnerable code:

Fixed code:
          compressed_pixels=(unsigned char *) RelinquishMagickMemory(
            compressed_pixels);
CVE-2019-7396 (C, published 2019-02-05T00:29Z)
Description: value: In ImageMagick before 7.0.8-25, a memory leak exists in ReadSIXELImage in coders/sixel.c.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-401 \u2014 Missing Release of Memory after Effective Lifetime
The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/sixel.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1452


Vulnerable code:

Fixed code:
      sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels);
CVE-2019-7397 (C, published 2019-02-05T00:29Z)
Description: value: In ImageMagick before 7.0.8-25 and GraphicsMagick through 1.3.31, several memory leaks exist in WritePDFImage in coders/pdf.c.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-401 \u2014 Missing Release of Memory after Effective Lifetime
The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/pdf.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/1454


Vulnerable code:
              {
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                ThrowPDFException(ResourceLimitError,"MemoryAllocationFailed");
              }
                {
                  xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                  ThrowPDFException(ResourceLimitError,
                    "MemoryAllocationFailed");
                }

Fixed code:
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
              ThrowPDFException(ResourceLimitError,"MemoryAllocationFailed");
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                ThrowPDFException(ResourceLimitError,"MemoryAllocationFailed");
                  xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                  xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
                xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
CVE-2020-27560 (C, published 2020-10-22T14:15Z)
Description: value: ImageMagick 7.0.10-34 allows Division by Zero in OptimizeLayerFrames in MagickCore/layer.c, which may cause a denial of service.
Severity: MEDIUM (CVSS v3 base score: 3.3)
Weakness: CWE-369 \u2014 Divide By Zero
The product divides a value by zero.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
MagickCore/layer.c
Commit message: There is a Division by Zero in function OptimizeLayerFrames (#2743)

in file MagickCore/layer.c. cur->ticks_per_seconds can be zero
with a crafted input argument *image. This is similar to
CVE-2019-13454.

Vulnerable code:
        time += curr->delay*1000/curr->ticks_per_second;
      time += curr->delay*1000/curr->ticks_per_second;

Fixed code:
        time +=(size_t) (curr->delay*1000*
          PerceptibleReciprocal((double) curr->ticks_per_second));
      time += (size_t)(curr->delay*1000*
        PerceptibleReciprocal((double) curr->ticks_per_second));
CVE-2020-27829 (Other, published 2021-03-26T17:15Z)
Description: value: A heap based buffer overflow in coders/tiff.c may result in program crash and denial of service in ImageMagick before 7.0.10-45.
Severity: MEDIUM (CVSS v3 base score: 5.5)
Weakness: CWE-122 \u2014 Heap-based Buffer Overflow
A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
ChangeLog
coders/tiff.c
Commit message: possible TIFF related-heap buffer overflow (alert & POC by Hardik Shah)


Vulnerable code:
          sizeof(*strip_pixels));

Fixed code:
2020-11-30  7.0.10-46  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-46 GIT revision 17...

2020-11-30  7.0.10-45  <quetzlzacatenango@image...>
  * possible TIFF related-heap buffer overflow (alert & POC by Hardik Shah).

          2*sizeof(*strip_pixels));
CVE-2021-20224 (C, published 2022-08-25T20:15Z)
Description: value: An integer overflow issue was discovered in ImageMagick's ExportIndexQuantum() function in MagickCore/quantum-export.c. Function calls to GetPixelIndex() could result in values outside the range of representable for the 'unsigned char'. When ImageMagick processes a crafted pdf file, this could lead to an undefined behaviour or a crash.
Severity: nan (CVSS v3 base score: 5.5)
Weakness: CWE-190 \u2014 Integer Overflow or Wraparound
The product performs a calculation that can
         produce an integer overflow or wraparound when the logic
         assumes that the resulting value will always be larger than
         the original value. This occurs when an integer value is
         incremented to a value that is too large to store in the
         associated representation. When this occurs, the value may
         become a very small or negative number.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
MagickCore/quantum-export.c
Commit message: outside the range of representable values of type 'unsigned char' (#3083)

Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com>

Vulnerable code:
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
            pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
        pixel=(unsigned char) GetPixelIndex(image,p);
          pixel=(unsigned char) GetPixelIndex(image,p);
        q=PopCharPixel((unsigned char) GetPixelIndex(image,p),q);

Fixed code:
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
            pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
          pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
        q=PopCharPixel((unsigned char) ((ssize_t) GetPixelIndex(image,p)),q);
CVE-2021-3574 (C, published 2022-08-26T16:15Z)
Description: value: A vulnerability was found in ImageMagick-7.0.11-5, where executing a crafted file with the convert command, ASAN detects memory leaks.
Severity: nan (CVSS v3 base score: 3.3)
Weakness: CWE-401 \u2014 Missing Release of Memory after Effective Lifetime
The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/tiff.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/3540


Vulnerable code:
    if (samples_per_pixel > MaxPixelChannels)
      {
        TIFFClose(tiff);
        ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
      }

Fixed code:
    if (samples_per_pixel > MaxPixelChannels)
      {
        TIFFClose(tiff);
        ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
      }
CVE-2021-3610 (C, published 2022-02-24T19:15Z)
Description: value: A heap-based buffer overflow vulnerability was found in ImageMagick in versions prior to 7.0.11-14 in ReadTIFFImage() in coders/tiff.c. This issue is due to an incorrect setting of the pixel array size, which can lead to a crash and segmentation fault.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/tiff.c
Commit message: eliminate heap buffer overflow vulnerability, thanks to ZhangJiaxing (@r0fm1a) from Codesafe Team of Legendsec at Qi'anxin Group


Vulnerable code:
        extent=2*TIFFStripSize(tiff);

Fixed code:
        extent=4*TIFFStripSize(tiff);
CVE-2021-39212 (C, published 2021-09-13T18:15Z)
Description: value: ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. In affected versions and in certain cases, Postscript files could be read and written when specifically excluded by a `module` policy in `policy.xml`. ex. <policy domain="module" rights="none" pattern="PS" />. The issue has been resolved in ImageMagick 7.1.0-7 and in 6.9.12-22. Fortunately, in the wild, few users utilize the `module` policy and instead use the `coder` policy that is also our workaround recommendation: <policy domain="coder" rights="none" pattern="{PS,EPI,EPS,EPSF,EPSI}" />.
Severity: LOW (CVSS v3 base score: 3.6)
Weakness: CWE-668 \u2014 Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
MagickCore/module.c
MagickCore/static.c
Commit message: Use the correct rights.


Vulnerable code:
  rights=AllPolicyRights;
  rights=AllPolicyRights;
        if (IsRightsAuthorized(ModulePolicyDomain,AllPolicyRights,

Fixed code:
  rights=ReadPolicyRights|WritePolicyRights;
  rights=ReadPolicyRights|WritePolicyRights;
  PolicyRights
    rights;

  rights=ReadPolicyRights|WritePolicyRights;
        if (IsRightsAuthorized(ModulePolicyDomain,rights,
CVE-2021-39212 (C, published 2021-09-13T18:15Z)
Description: value: ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. In affected versions and in certain cases, Postscript files could be read and written when specifically excluded by a `module` policy in `policy.xml`. ex. <policy domain="module" rights="none" pattern="PS" />. The issue has been resolved in ImageMagick 7.1.0-7 and in 6.9.12-22. Fortunately, in the wild, few users utilize the `module` policy and instead use the `coder` policy that is also our workaround recommendation: <policy domain="coder" rights="none" pattern="{PS,EPI,EPS,EPSF,EPSI}" />.
Severity: LOW (CVSS v3 base score: 3.6)
Weakness: CWE-668 \u2014 Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
MagickCore/static.c
Commit message: Added missing policy checks in RegisterStaticModules.


Vulnerable code:
  rights=ReadPolicyRights;

Fixed code:
  rights=AllPolicyRights;
        if (IsRightsAuthorized(ModulePolicyDomain,AllPolicyRights,
              MagickModules[i].module) == MagickFalse)
          continue;
CVE-2021-3962 (C, published 2021-11-19T17:15Z)
Description: value: A flaw was found in ImageMagick where it did not properly sanitize certain input before using it to invoke convert processes. This flaw allows an attacker to create a specially crafted image that leads to a use-after-free vulnerability when processed by ImageMagick. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.
Severity: MEDIUM (CVSS v3 base score: 7.8)
Weakness: CWE-416 \u2014 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/dcm.c
Commit message: Moved the free to the correct position to fix #4446.


Vulnerable code:
        RelinquishDCMMemory(&info,&map,stream_info,stack,data);

Fixed code:
        else
          RelinquishDCMMemory(&info,&map,stream_info,stack,data);
CVE-2022-0284 (C, published 2022-08-29T15:15Z)
Description: value: A heap-based-buffer-over-read flaw was found in ImageMagick's GetPixelAlpha() function of 'pixel-accessor.h'. This vulnerability is triggered when an attacker passes a specially crafted Tagged Image File Format (TIFF) image to convert it into a PICON file format. This issue can potentially lead to a denial of service and information disclosure.
Severity: nan (CVSS v3 base score: 7.1)
Weakness: CWE-125 \u2014 Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/xpm.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/4729


Vulnerable code:
              if (GetPixelAlpha(image,q) == (Quantum) TransparentAlpha)
          if (GetPixelAlpha(image,q) == (Quantum) TransparentAlpha)

Fixed code:
              if (GetPixelAlpha(picon,q) == (Quantum) TransparentAlpha)
          if (GetPixelAlpha(picon,q) == (Quantum) TransparentAlpha)
CVE-2022-1115 (C, published 2022-08-29T15:15Z)
Description: value: A heap-buffer-overflow flaw was found in ImageMagick’s PushShortPixel() function of quantum-private.h file. This vulnerability is triggered when an attacker passes a specially crafted TIFF image file to ImageMagick for conversion, potentially leading to a denial of service.
Severity: nan (CVSS v3 base score: 5.5)
Weakness: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/tiff.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/4974


Vulnerable code:
        extent=MagickMax(rows*TIFFTileRowSize(tiff),TIFFTileSize(tiff));

Fixed code:
        extent=4*MagickMax(rows*TIFFTileRowSize(tiff),TIFFTileSize(tiff));
CVE-2022-28463 (C, published 2022-05-08T23:15Z)
Description: value: ImageMagick 7.1.0-27 is vulnerable to Buffer Overflow.
Severity: MEDIUM (CVSS v3 base score: 7.8)
Weakness: CWE-120 \u2014 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/cin.c
Commit message: https://github.com/ImageMagick/ImageMagick/issues/4988


Vulnerable code:

Fixed code:
  if (cin.file.image_offset < 712)
    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
CVE-2022-3213 (C, published 2022-09-19T18:15Z)
Description: value: A heap buffer overflow issue was found in ImageMagick. When an application processes a malformed TIFF file, it could lead to undefined behavior or a crash causing a denial of service.
Severity: nan (CVSS v3 base score: 5.5)
Weakness: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/ImageMagick/ImageMagick
Files changed:
coders/tiff.c
Commit message: squash heap-buffer-overflow, PoC TIFF from Hardik


Vulnerable code:
        extent=4*(samples_per_pixel+1)*TIFFStripSize(tiff);

Fixed code:
        extent=4*((image->depth+7)/8)*(samples_per_pixel+1)*TIFFStripSize(tiff);