Mercurial > hg > orthanc
comparison Core/Images/JpegReader.cpp @ 3378:596cfabd72c5
Fixed a couple of truncation warnings
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 17 May 2019 08:36:18 +0200 |
parents | 4e43e67f8ecf |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3377:05881bf99c83 | 3378:596cfabd72c5 |
---|---|
159 | 159 |
160 if (setjmp(jerr.GetJumpBuffer())) | 160 if (setjmp(jerr.GetJumpBuffer())) |
161 { | 161 { |
162 jpeg_destroy_decompress(&cinfo); | 162 jpeg_destroy_decompress(&cinfo); |
163 throw OrthancException(ErrorCode_InternalError, | 163 throw OrthancException(ErrorCode_InternalError, |
164 "Error during JPEG decoding: " + jerr.GetMessage()); | 164 "Error during JPEG decoding: " + jerr.GetMessage()); |
165 } | 165 } |
166 | 166 |
167 // Below this line, we are under the scope of a "setjmp" | 167 // Below this line, we are under the scope of a "setjmp" |
168 jpeg_create_decompress(&cinfo); | 168 jpeg_create_decompress(&cinfo); |
169 jpeg_mem_src(&cinfo, const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>(buffer)), size); | 169 jpeg_mem_src(&cinfo, |
170 const_cast<unsigned char*>( | |
171 reinterpret_cast<const unsigned char*>(buffer)), | |
172 static_cast<unsigned long>(size)); | |
170 | 173 |
171 try | 174 try |
172 { | 175 { |
173 Uncompress(cinfo, content_, *this); | 176 Uncompress(cinfo, content_, *this); |
174 } | 177 } |