1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(video): correctly align data passed to toxcore

fixes #5402

c-toxcore requires each plane to be aligned at 1 byte boundaries.
Because of this bug we alligned it at 32 byte boundaries if the height
and width were a multiple of 8.
This commit is contained in:
sudden6 2018-11-03 15:11:16 +01:00
parent 9ecb6da051
commit 5c1fe52010
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -575,7 +575,9 @@ AVFrame* VideoFrame::generateAVFrame(const QSize& dimensions, const int pixelFor
int bufSize;
if (!requireAligned || (dimensions.width() % 8 == 0 && dimensions.height() % 8 == 0)) {
const bool alreadyAligned = dimensions.width() % dataAlignment == 0 && dimensions.height() % dataAlignment == 0;
if (!requireAligned || alreadyAligned) {
bufSize = av_image_alloc(ret->data, ret->linesize, dimensions.width(), dimensions.height(),
static_cast<AVPixelFormat>(pixelFormat), dataAlignment);
} else {