SysTryReturn(NID_MEDIA, filePath.GetLength() > 0 && filePath.GetLength() <= PATH_MAX, null, E_INVALID_ARG,
"[E_INVALID_ARG] Given filePath length is zero or exceeds system limitations Length = %d.",filePath.GetLength());
- SysTryReturn(NID_MEDIA, File::IsFileExist(filePath), null, E_FILE_NOT_FOUND,
+ SysSecureTryReturn(NID_MEDIA, File::IsFileExist(filePath), null, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] filePath:%ls", filePath.GetPointer());
r = dec.Construct(filePath, pixelFormat, IMG_FORMAT_NONE, autoRotate);
ByteBuffer* pBuf = null;
pBuf = _MediaUtil::FileToBufferN(srcImageFile, _ImageUtil::MinImageFormatLength());
- SysTryCatch(NID_MEDIA, pBuf != null, , GetLastResult(),
+ SysSecureTryCatch(NID_MEDIA, pBuf != null, , GetLastResult(),
"[%s] _MediaUtil::FileToBufferN failed for %ls.",
GetErrorMessage(GetLastResult()), srcImageFile.GetPointer());
ByteBuffer* pBuf = null;
pBuf = _MediaUtil::FileToBufferN(srcImageFile);
- SysTryCatch(NID_MEDIA, pBuf != null, , GetLastResult(),
+ SysSecureTryCatch(NID_MEDIA, pBuf != null, , GetLastResult(),
"[%s] _MediaUtil::FileToBufferN failed for %ls.",
GetErrorMessage(GetLastResult()), srcImageFile.GetPointer());
hasAlpha = HasAlphaChannel(*pBuf);
"[E_FILE_NOT_FOUND] path is empty");
SysTryReturn(NID_MEDIA, path.GetLength() > 0 && path.GetLength() <= PATH_MAX, null, E_INVALID_ARG,
"[E_INVALID_ARG] Given filePath length is zero or exceeds system limitations.");
- SysTryReturn(NID_MEDIA, File::IsFileExist(path), null, E_FILE_NOT_FOUND,
+ SysSecureTryReturn(NID_MEDIA, File::IsFileExist(path), null, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] filePath:%ls", path.GetPointer());
r = file.Construct(path, L"rb");
- SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r,
+ SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, null, r,
"[%s] file.Construct failed. File name (%ls)", GetErrorMessage(r), path.GetPointer());
file.Seek(FILESEEKPOSITION_END, 0);
size = file.Tell();
file.Seek(FILESEEKPOSITION_BEGIN, 0);
- SysTryReturn(NID_MEDIA, size > 0, null, E_DATA_NOT_FOUND,
+ SysSecureTryReturn(NID_MEDIA, size > 0, null, E_DATA_NOT_FOUND,
"[E_DATA_NOT_FOUND] File size is 0: %ls", path.GetPointer());
pBuf.reset(new (std::nothrow) ByteBuffer());
GetErrorMessage(r), size);
r = file.Read(*pBuf.get());
- SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated. File.Read failed: %ls",
+ SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated. File.Read failed: %ls",
GetErrorMessage(r), path.GetPointer());
}
else
GetErrorMessage(r), maxSize);
r = file.Read(*pBuf.get());
- SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated. File.Read failed: %ls",
+ SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated. File.Read failed: %ls",
GetErrorMessage(r), path.GetPointer());
}
}
r = file.Construct(dstPath, "wb", true);
- SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagated. File.Construct failed for %ls",
+ SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagated. File.Construct failed for %ls",
GetErrorMessage(r), dstPath.GetPointer());
r = file.Write(srcBuf);
- SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagated. File.Write failed for %ls",
+ SysSecureTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagated. File.Write failed for %ls",
GetErrorMessage(r), dstPath.GetPointer());
CATCH: