[Spice-commits] server/mjpeg-encoder.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 17 06:46:08 UTC 2020


 server/mjpeg-encoder.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8d8745211d70257423a97be426485a957f4dc73d
Author: Uri Lublin <uril at redhat.com>
Date:   Wed Jul 15 18:18:54 2020 +0300

    mjpeg_encoder_reset_quality: do not hint inline
    
    Let the compiler decide.
    
    Apparently it causes CI makecheck to fail (see below).
    Seems to me it's a gcc problem -- was working with version 9,
    fails with version 10.
    Making the function a non-inline one "fixes" this issue.
    Alternatively adding to the structure "int dummy" above the "int type"
    "fixes" the build too (but I went with the non-inline solution).
    
    ==== error ====
      CC       mjpeg-encoder.lo
    In file included from /usr/include/string.h:495,
                     from ../../server/red-common.h:24,
                     from ../../server/mjpeg-encoder.c:25:
    In function ‘memset’,
        inlined from ‘mjpeg_encoder_reset_quality’ at ../../server/mjpeg-encoder.c:385:5,
        inlined from ‘mjpeg_encoder_quality_eval_stop.part.0’ at ../../server/mjpeg-encoder.c:999:5:
    /usr/include/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [788, 871] from the object at ‘encoder’ is out of the bounds of referenced subobject ‘type’ with type ‘int’ at offset 784 [-Werror=array-bounds]
       71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../server/mjpeg-encoder.c: In function ‘mjpeg_encoder_quality_eval_stop.part.0’:
    ../../server/mjpeg-encoder.c:96:9: note: subobject ‘type’ declared here
       96 |     int type;
          |         ^~~~
    cc1: all warnings being treated as errors
    
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/mjpeg-encoder.c b/server/mjpeg-encoder.c
index 59bdf9d2..0b4f5a4c 100644
--- a/server/mjpeg-encoder.c
+++ b/server/mjpeg-encoder.c
@@ -363,10 +363,10 @@ static uint32_t get_max_fps(uint64_t frame_size, uint64_t bytes_per_sec)
     return frame_size ? bytes_per_sec / frame_size : MJPEG_MAX_FPS;
 }
 
-static inline void mjpeg_encoder_reset_quality(MJpegEncoder *encoder,
-                                               int quality_id,
-                                               uint32_t fps,
-                                               uint64_t frame_enc_size)
+static void mjpeg_encoder_reset_quality(MJpegEncoder *encoder,
+                                        int quality_id,
+                                        uint32_t fps,
+                                        uint64_t frame_enc_size)
 {
     MJpegEncoderRateControl *rate_control = &encoder->rate_control;
     double fps_ratio;


More information about the Spice-commits mailing list