Project

General

Profile

Actions

Bug #951

open

Refactor calcElementLength()

Added by Jan Schlamelcher almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Module:
Operating System:
Compiler:

Description

The current implementation of calcElementLength() is prone to integer overflow errors since the result is always returned as a 32 bit integer. It should be refactored to return size_t so that we can always finish the calculation correctly (since size_t is the type to allow access to all the available memory depending on the target platform, is should always be sufficient to calculate the length of an object in the executing machine's memory). Handling size limits (i.e. encoding the length as a 32 bit value when writing DICOM data) shall then be implemented at one single place in the code only (during write, not during length calculation).


Related issues 2 (1 open1 closed)

Related to DCMTK - Feature #806: Maximum value returned by calcElementLength() is limited to 2^32-1New2017-12-13

Actions
Follows DCMTK - Bug #857: Implementation and documentation of calcElementLength() are inconsistentClosedJan Schlamelcher2018-11-26

Actions
Actions

Also available in: Atom PDF