summaryrefslogtreecommitdiffstats
path: root/src/multimedia/video/qvideoframe.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-21 11:42:33 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-28 07:11:25 +0000
commit0a6a1883b6dde64b195a564a0c02a949d7718b25 (patch)
tree52179cd2a8bd526dd006faef3a6d9324efb69e42 /src/multimedia/video/qvideoframe.cpp
parent02cb4fc0b53cc934c920c156bd10d17a91148034 (diff)
Fix tst_qvideoframe test failures
Change-Id: I25bceb948518ba49053ae87484bdd8375b616b20 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video/qvideoframe.cpp')
-rw-r--r--src/multimedia/video/qvideoframe.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index 8f95706bb..a120d850b 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -291,7 +291,7 @@ QVideoFrame::QVideoFrame(const QVideoFrameFormat &format)
// Check the memory was successfully allocated.
if (!data.isEmpty())
- d->buffer = new QMemoryVideoBuffer(data, textureDescription->stride*format.frameWidth());
+ d->buffer = new QMemoryVideoBuffer(data, textureDescription->strideForWidth(format.frameWidth()));
}
}
@@ -751,6 +751,8 @@ int QVideoFrame::planeCount() const
*/
quint64 QVideoFrame::textureHandle(int plane) const
{
+ if (!d->buffer)
+ return 0;
return d->buffer->textureHandle(plane);
}