From: JungYumin Date: Thu, 18 Apr 2013 08:32:30 +0000 (+0900) Subject: Applied secure log for privacy protect X-Git-Tag: 2.1b_release~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fframework%2Fnative%2Fimage.git;a=commitdiff_plain;h=5ed3fbc57e3ddcf013290ee298a9d97933d22884 Applied secure log for privacy protect Change-Id: Ie7b421142ad05c6b1abf782db9f1f74cb8ad0cf6 Signed-off-by: JungYumin --- diff --git a/src/FMediaImage.cpp b/src/FMediaImage.cpp index b391fd6..75f01d5 100644 --- a/src/FMediaImage.cpp +++ b/src/FMediaImage.cpp @@ -86,7 +86,7 @@ Image::DecodeN(const String& srcImagePath, BitmapPixelFormat pixelFormat) const SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)), r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat); @@ -104,7 +104,7 @@ Image::DecodeN(const String& srcImagePath, BitmapPixelFormat pixelFormat, int de SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)), r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat); @@ -167,7 +167,7 @@ Image::DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapP SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)), r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat); @@ -245,7 +245,7 @@ Image::ConvertN(const String& srcImagePath, ImageFormat destImageFormat) const SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] path is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); SysTryCatch(NID_MEDIA, ((destImageFormat>IMG_FORMAT_NONE) && (destImageFormat<=IMG_FORMAT_WBMP)), r = E_UNSUPPORTED_FORMAT, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] destImageFormat:%d", destImageFormat); @@ -265,7 +265,7 @@ Image::CompressJpeg(const Tizen::Base::String& srcImagePath, const Tizen::Base:: SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); // CompressJpeg should accept only jpeg encoded images. @@ -347,7 +347,7 @@ Image::DecodeToBufferN(const Tizen::Base::String& srcImagePath, SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)), r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat); @@ -373,7 +373,7 @@ Image::GetImageFormat(const Tizen::Base::String& srcImagePath) const SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); fmt = _ImageUtilImpl::GetImageFormat(srcImagePath); r = GetLastResult(); @@ -420,7 +420,7 @@ Image::HasAlphaChannels(const Tizen::Base::String& srcImagePath) const SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use."); SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty"); - SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer()); return _ImageUtilImpl::HasAlphaChannel(srcImagePath); diff --git a/src/FMediaImageBuffer.cpp b/src/FMediaImageBuffer.cpp index d216051..318d163 100644 --- a/src/FMediaImageBuffer.cpp +++ b/src/FMediaImageBuffer.cpp @@ -91,7 +91,7 @@ ImageBuffer::Construct(const Tizen::Base::String &srcImagePath, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); SysTryReturnResult(NID_MEDIA, !srcImagePath.IsEmpty(), E_INVALID_ARG,"path is empty."); - SysTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, + SysSecureTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, "file not found: %ls", srcImagePath.GetPointer()); _ImageBufferImpl* pImageBufferImpl = new (std::nothrow) _ImageBufferImpl(); @@ -188,7 +188,7 @@ ImageBuffer::Construct(const Tizen::Base::String &srcImagePath, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); SysTryReturnResult(NID_MEDIA, !srcImagePath.IsEmpty(), E_INVALID_ARG,"path is empty."); - SysTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, + SysSecureTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, "file not found: %ls", srcImagePath.GetPointer()); _ImageBufferImpl* pImageBufferImpl = new (std::nothrow) _ImageBufferImpl(); @@ -451,7 +451,7 @@ ImageBuffer::GetImageInfo(const String& srcImagePath, ImageFormat& imageFormat, SysTryReturn(NID_MEDIA, !srcImagePath.IsEmpty(), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] path is empty"); - SysTryReturn(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, + SysSecureTryReturn(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] file not found: %ls", srcImagePath.GetPointer()); r = _ImageBufferImpl::GetImageInfo(srcImagePath, imageFormat, width, height); diff --git a/src/FMedia_GifDecoderImpl.cpp b/src/FMedia_GifDecoderImpl.cpp index 51687c7..4f3556f 100644 --- a/src/FMedia_GifDecoderImpl.cpp +++ b/src/FMedia_GifDecoderImpl.cpp @@ -59,7 +59,7 @@ _GifDecoderImpl::Construct(const Tizen::Base::String& filePath, MediaPixelFormat pByteBuffer.reset(_MediaUtil::FileToBufferN(filePath, 0)); r = GetLastResult(); - SysTryReturn(NID_MEDIA, pByteBuffer.get() != null, r, r, "FiltToeBufferN:%S", filePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pByteBuffer.get() != null, r, r, "FiltToeBufferN:%ls", filePath.GetPointer()); r = __pGifDecoder->Construct(pByteBuffer->GetPointer(), pByteBuffer->GetLimit(), pixelFormat); if (r != E_SUCCESS) { diff --git a/src/FMedia_ImageBufferImpl.cpp b/src/FMedia_ImageBufferImpl.cpp index 49f6f1d..617bd17 100644 --- a/src/FMedia_ImageBufferImpl.cpp +++ b/src/FMedia_ImageBufferImpl.cpp @@ -183,8 +183,8 @@ _ImageBufferImpl::Construct(const Tizen::Base::String &srcImagePath, const Recta std::unique_ptr pBuf; pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); r = Construct(*pBuf.get(), pDecodingRegion, autoRotate); SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] ImageBuffer construct failed.", GetErrorMessage(r)); return r; @@ -512,8 +512,8 @@ _ImageBufferImpl::Construct(const Tizen::Base::String &srcImagePath, int destWid std::unique_ptr pBuf; pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); r = Construct(*pBuf.get(), destWidth, destHeight, scalingMethod); SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] ImageBuffer construct failed.", GetErrorMessage(r)); return r; diff --git a/src/FMedia_ImageImpl.cpp b/src/FMedia_ImageImpl.cpp index 30eba25..a32ed92 100644 --- a/src/FMedia_ImageImpl.cpp +++ b/src/FMedia_ImageImpl.cpp @@ -128,8 +128,8 @@ _ImageImpl::DecodeToBitmapN(const Tizen::Base::String& srcImagePath, Tizen::Grap Bitmap* pBmp = null; pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat); return pBmp; @@ -211,8 +211,8 @@ _ImageImpl::DecodeToBitmapN(const Tizen::Base::String& srcImagePath, Tizen::Grap Bitmap* pBmp = null; pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat, destDim, bufferScaling); return pBmp; @@ -378,8 +378,8 @@ _ImageImpl::DecodeToBitmapN(const Tizen::Base::String& srcImagePath, Tizen::Grap Bitmap* pBmp = null; pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat, destDim); return pBmp; @@ -399,8 +399,8 @@ _ImageImpl::DecodeToBufferN(const Tizen::Base::String& srcImagePath, //"[E_OUT_OF_RANGE] dest dimension:%d,%d", dstDim.width, dstDim.height); pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath)); - SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), - "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); + SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(), + "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer()); pRetBuf = DecodeToBufferN(*pBuf.get(), restDim, dstDim, pixelFormat, imgFormat, keepAspectRatio); return pRetBuf; diff --git a/src/FMedia_ImageUriData.cpp b/src/FMedia_ImageUriData.cpp index 37ed5bd..b3f0fc7 100644 --- a/src/FMedia_ImageUriData.cpp +++ b/src/FMedia_ImageUriData.cpp @@ -243,7 +243,7 @@ _ImageUriData::RequestDownload(const Utility::Uri &downloadUri, SysTryCatch(NID_MEDIA, __pRequestImpl != null, r = GetLastResult(), GetLastResult(), "[%s] Failed to get the managed httprequest.", GetErrorMessage(GetLastResult())); - SysLog(NID_MEDIA, "Uri = %S", downloadUri.ToString().GetPointer()); + SysSecureLog(NID_MEDIA, "Uri = %ls", downloadUri.ToString().GetPointer()); r = __pRequestImpl->SetUri(downloadUri.ToString()); SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to set uri into the HTTP request.", GetErrorMessage(r));