From a32c04848f996dd9e5a5cbf175f2498b3d873d4f Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Thu, 6 Apr 2023 18:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- services/common/databuffer/src/data_buffer.cpp | 2 +- services/common/imageJpeg/src/jpeg_image_processor.cpp | 2 +- .../screensinkprocessor/decoder/src/image_sink_decoder.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/common/databuffer/src/data_buffer.cpp b/services/common/databuffer/src/data_buffer.cpp index 12ac906b..d35d1eb7 100644 --- a/services/common/databuffer/src/data_buffer.cpp +++ b/services/common/databuffer/src/data_buffer.cpp @@ -120,7 +120,7 @@ std::vector DataBuffer::GetDirtyRectVec() int32_t DataBuffer::GetData(int32_t offset, int32_t datasize, uint8_t* &output) { - if (offset + datasize > capacity_ || output == nullptr) { + if (static_cast(offset + datasize) > capacity_ || output == nullptr) { DHLOGE("DataBuffer GetData parameter invalid."); return ERR_DH_SCREEN_INPUT_PARAM_INVALID; } diff --git a/services/common/imageJpeg/src/jpeg_image_processor.cpp b/services/common/imageJpeg/src/jpeg_image_processor.cpp index 5fa6337c..40a6d0f8 100644 --- a/services/common/imageJpeg/src/jpeg_image_processor.cpp +++ b/services/common/imageJpeg/src/jpeg_image_processor.cpp @@ -282,7 +282,7 @@ void JpegImageProcessor::DecompressJpegToNV12(size_t jpegSize, uint8_t *inputDat #endif while (cinfo.output_scanline < cinfo.output_height) { (void)jpeg_read_scanlines(&cinfo, buffer, 1); - for (int j = 0 ; j < cinfo.output_width ; j++) { + for (unsigned int j = 0 ; j < cinfo.output_width ; j++) { #ifdef LIBYUV rgb[rgbIndex++] = buffer[0][j * RGB_CHROMA + TWO]; rgb[rgbIndex++] = buffer[0][j * RGB_CHROMA + 1]; diff --git a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp index 687c2527..4a869126 100644 --- a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp +++ b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp @@ -135,7 +135,7 @@ void ImageSinkDecoder::OffsetProcess(sptr surfaceBuffer, sptrGetStride(); int32_t chromaOffset = configParam_.GetVideoWidth() * configParam_.GetVideoHeight(); - for (int32_t yh = 0 ; yh < configParam_.GetVideoHeight() ; yh++) { + for (unsigned int yh = 0 ; yh < configParam_.GetVideoHeight() ; yh++) { int32_t ret = memcpy_s(windowSurfaceAddr + dstDataOffset, chromaOffset - dstDataOffset, surfaceAddr + srcDataOffset, configParam_.GetVideoWidth()); if (ret != EOK) { @@ -148,7 +148,7 @@ void ImageSinkDecoder::OffsetProcess(sptr surfaceBuffer, sptrGetStride(); - if (alignedWidth == configParam_.GetVideoWidth() && alignedHeight_ == configParam_.GetVideoHeight()) { + if (static_cast(alignedWidth) == configParam_.GetVideoWidth() && + static_cast(alignedHeight_) == configParam_.GetVideoHeight()) { NormalProcess(surfaceBuffer, windowSurfaceBuffer); } else { OffsetProcess(surfaceBuffer, windowSurfaceBuffer); -- Gitee