[vlc-commits] [Git][videolan/vlc][master] qt: fix out of bound while evaluating gtk colors

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Nov 29 18:41:39 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
80087285 by Pierre Lamot at 2022-11-29T18:18:15+00:00
qt: fix out of bound while evaluating gtk colors

interpreting ARGB32 data as uint64_t data causes an OOB

- - - - -


1 changed file:

- modules/gui/qt/style/gtkthemeprovider/gtk_util.cpp


Changes:

=====================================
modules/gui/qt/style/gtkthemeprovider/gtk_util.cpp
=====================================
@@ -217,12 +217,12 @@ GdkRGBA CairoSurface::GetAveragePixelValue(bool frame) {
     int stride = cairo_image_surface_get_stride(surface_);
     assert(cairo_image_surface_get_format(surface_) == CAIRO_FORMAT_ARGB32);
     long a = 0, r = 0, g = 0, b = 0;
-    uint64_t max_alpha = 0;
+    uint32_t max_alpha = 0;
     for (int line = 0; line < height; line++)
     {
-        uint64_t* rgbaLine = (uint64_t*)(&data[line*stride]);
+        uint32_t* rgbaLine = (uint32_t*)(&data[line*stride]);
         for (int i = 0; i < width; i++) {
-            uint64_t color =  rgbaLine[i];
+            uint32_t color =  rgbaLine[i];
             max_alpha = std::max((color >> 24) & 0xFF, max_alpha);
             a += (color >> 24) & 0xFF;
             r += (color >> 16) & 0xFF;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/80087285b449479469440c270b231dd7ba622a65

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/80087285b449479469440c270b231dd7ba622a65
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list