Skip to content

Commit 8a8e43e

Browse files
committed
Use non-throwing new operator.
Use a non-throwing new operator when allocating huge amounts of memory.
1 parent b5a0196 commit 8a8e43e

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dcmimage/include/dcmtk/dcmimage/dicomot.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1996-2016, OFFIS e.V.
3+
* Copyright (C) 1996-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -88,7 +88,7 @@ class DiColorMonoTemplate
8888
{
8989
if (pixel != NULL)
9090
{
91-
this->Data = new T[this->Count];
91+
this->Data = new (std::nothrow) T[this->Count];
9292
if (this->Data != NULL)
9393
{
9494
const T *r = pixel[0];

dcmimgle/include/dcmtk/dcmimgle/dimocpt.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1996-2010, OFFIS e.V.
3+
* Copyright (C) 1996-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -82,7 +82,7 @@ class DiMonoCopyTemplate
8282
{
8383
if (pixel != NULL)
8484
{
85-
this->Data = new T[this->getCount()];
85+
this->Data = new (std::nothrow) T[this->getCount()];
8686
if (this->Data != NULL)
8787
OFBitmanipTemplate<T>::copyMem(pixel, this->Data, this->getCount());
8888
}

dcmimgle/include/dcmtk/dcmimgle/dimoflt.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1996-2011, OFFIS e.V.
3+
* Copyright (C) 1996-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -95,7 +95,7 @@ class DiMonoFlipTemplate
9595
{
9696
if (pixel != NULL)
9797
{
98-
this->Data = new T[this->getCount()];
98+
this->Data = new (std::nothrow) T[this->getCount()];
9999
if (this->Data != NULL)
100100
{
101101
if (horz && vert)

dcmimgle/include/dcmtk/dcmimgle/dimorot.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1996-2011, OFFIS e.V.
3+
* Copyright (C) 1996-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -94,7 +94,7 @@ class DiMonoRotateTemplate
9494
{
9595
if (pixel != NULL)
9696
{
97-
this->Data = new T[DiMonoPixelTemplate<T>::getCount()];
97+
this->Data = new (std::nothrow) T[DiMonoPixelTemplate<T>::getCount()];
9898
if (this->Data != NULL)
9999
{
100100
if (degree == 90)

dcmimgle/include/dcmtk/dcmimgle/dimosct.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 1996-2011, OFFIS e.V.
3+
* Copyright (C) 1996-2025, OFFIS e.V.
44
* All rights reserved. See COPYRIGHT file for details.
55
*
66
* This software and supporting documentation were developed by
@@ -112,7 +112,7 @@ class DiMonoScaleTemplate
112112
{
113113
if (pixel != NULL)
114114
{
115-
this->Data = new T[this->getCount()];
115+
this->Data = new (std::nothrow) T[this->getCount()];
116116
if (this->Data != NULL)
117117
{
118118
const T value = OFstatic_cast(T, OFstatic_cast(double, DicomImageClass::maxval(bits)) *

0 commit comments

Comments
 (0)