comparison OrthancFramework/Sources/Images/PngReader.cpp @ 4201:2d5209153b32

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Sep 2020 08:18:28 +0200
parents bf7b9edf6b81
children d9473bd5ed43
comparison
equal deleted inserted replaced
4200:7112a8af0b63 4201:2d5209153b32
40 { 40 {
41 struct FileRabi 41 struct FileRabi
42 { 42 {
43 FILE* fp_; 43 FILE* fp_;
44 44
45 FileRabi(const char* filename) 45 explicit FileRabi(const char* filename)
46 { 46 {
47 fp_ = SystemToolbox::OpenFile(filename, FileMode_ReadBinary); 47 fp_ = SystemToolbox::OpenFile(filename, FileMode_ReadBinary);
48 if (!fp_) 48 if (!fp_)
49 { 49 {
50 throw OrthancException(ErrorCode_InexistentFile); 50 throw OrthancException(ErrorCode_InexistentFile);
79 info_ = NULL; 79 info_ = NULL;
80 endInfo_ = NULL; 80 endInfo_ = NULL;
81 } 81 }
82 } 82 }
83 83
84 PngRabi() 84 PngRabi() :
85 { 85 png_(NULL),
86 png_ = NULL; 86 info_(NULL),
87 info_ = NULL; 87 endInfo_(NULL)
88 endInfo_ = NULL; 88 {
89
90 png_ = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 89 png_ = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
91 if (!png_) 90 if (!png_)
92 { 91 {
93 throw OrthancException(ErrorCode_NotEnoughMemory); 92 throw OrthancException(ErrorCode_NotEnoughMemory);
94 } 93 }