summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormio <[email protected]>2024-08-22 20:57:37 +1000
committerMichele Calgaro <[email protected]>2024-08-22 21:23:47 +0900
commit0f19d223daa8ef950149950b3efc23ecc23baf7e (patch)
tree916eec578cca92fd09a52f86dcaf98b6331a712c
parentbfc5ced7251a773413631cfa65509d4a2cadfeae (diff)
downloadkaffeine-0f19d223daa8ef950149950b3efc23ecc23baf7e.tar.gz
kaffeine-0f19d223daa8ef950149950b3efc23ecc23baf7e.zip
Use safer xine_get_current_frame_s
xine_get_current_frame was deprecated back in 2019 because it is "unsafe by design"[0]. The '_s' version was introduced in xine-lib 1.1.11, which was released in 2008, so there are no version checks. [0]: https://sourceforge.net/p/xine/xine-lib-1.2/ci/c1a154c1a89759a8d69a6895587085adf6868d50 Signed-off-by: mio <[email protected]> (cherry picked from commit f0b65f432b2e602bd9a515bcc460bcd6790a4925)
-rw-r--r--kaffeine/src/player-parts/xine-part/kxinewidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/kaffeine/src/player-parts/xine-part/kxinewidget.cpp b/kaffeine/src/player-parts/xine-part/kxinewidget.cpp
index c6535e6..7361e19 100644
--- a/kaffeine/src/player-parts/xine-part/kxinewidget.cpp
+++ b/kaffeine/src/player-parts/xine-part/kxinewidget.cpp
@@ -3834,17 +3834,18 @@ void KXineWidget::getScreenshot(uchar*& rgb32BitData, int& videoWidth, int& vide
int width, height, ratio, format;
// double desired_ratio, image_ratio;
- if (!xine_get_current_frame(m_xineStream, &width, &height, &ratio, &format, NULL))
+ if (!xine_get_current_frame_s(m_xineStream, &width, &height, &ratio, &format, nullptr, nullptr))
return;
- yuv = new uint8_t[((width+8) * (height+1) * 2)];
+ int yuv_size = ((width + 8) * (height + 1)) * 2;
+ yuv = new uint8_t[yuv_size];
if (yuv == NULL)
{
errorOut("Not enough memory to make screenshot!");
return;
}
- xine_get_current_frame(m_xineStream, &width, &height, &ratio, &format, yuv);
+ xine_get_current_frame_s(m_xineStream, &width, &height, &ratio, &format, yuv, &yuv_size);
videoWidth = width;
videoHeight = height;