Browse Source

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.
reviewable/pr5424/r1
sudden6 7 years ago
parent
commit
5c1fe52010
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 4
      src/video/videoframe.cpp

4
src/video/videoframe.cpp

@ -575,7 +575,9 @@ AVFrame* VideoFrame::generateAVFrame(const QSize& dimensions, const int pixelFor @@ -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…
Cancel
Save