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>
(cherry picked from commit f0b65f432b)
r14.1.x
mio 3 months ago committed by Michele Calgaro
parent bfc5ced725
commit 0f19d223da
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -3834,17 +3834,18 @@ void KXineWidget::getScreenshot(uchar*& rgb32BitData, int& videoWidth, int& vide
int width, height, ratio, format; int width, height, ratio, format;
// double desired_ratio, image_ratio; // 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; 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) if (yuv == NULL)
{ {
errorOut("Not enough memory to make screenshot!"); errorOut("Not enough memory to make screenshot!");
return; 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; videoWidth = width;
videoHeight = height; videoHeight = height;

Loading…
Cancel
Save