diff --git a/services/common/databuffer/src/data_buffer.cpp b/services/common/databuffer/src/data_buffer.cpp index 12ac906b2d378602750bbb41df255013f85a77e2..d35d1eb7a905f7a457920cff72d2338b4803250a 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 5fa6337c30a11f92d22360fe154a896a627f5f40..40a6d0f894609cd1e19641d86b239362a0c20a2b 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 687c25271c63243749f75700ed6b824200761f23..4a8691266755104b3044c26ad13eb91d784dfbec 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);