File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,15 +219,15 @@ namespace
219219 }
220220 }
221221
222- if (!formatFound)
222+ if (!formatFound || (size < 3 ) )
223223 {
224224 return E_FAIL;
225225 }
226226
227227 // Get orientation
228228 char orientation[256 ] = {};
229229
230- const size_t len = FindEOL (info, std::min<size_t >(sizeof (orientation), size - 1 ));
230+ const size_t len = FindEOL (info, std::min<size_t >(sizeof (orientation) - 1 , size ));
231231 if (len == size_t (-1 )
232232 || len <= 2 )
233233 {
@@ -236,7 +236,7 @@ namespace
236236
237237 strncpy_s (orientation, info, len);
238238
239- if (orientation[0 ] != ' -' && orientation[1 ] != ' Y' )
239+ if (orientation[0 ] != ' -' || orientation[1 ] != ' Y' )
240240 {
241241 // We only support the -Y +X orientation (see top of file)
242242 return (static_cast <unsigned long >(((orientation[0 ] == ' +' || orientation[0 ] == ' -' ) && (orientation[1 ] == ' X' || orientation[1 ] == ' Y' ))))
You can’t perform that action at this time.
0 commit comments