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:
parent
9ecb6da051
commit
5c1fe52010
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user