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]:
c1a154c1a8

Signed-off-by: mio <stigma@disroot.org>
pull/37/head
mio 3 months ago
parent a41aeeed01
commit f0b65f432b

@ -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;

Loading…
Cancel
Save