diff --git a/src/video/videoframe.cpp b/src/video/videoframe.cpp index a58bf72ac..fd742f1d3 100644 --- a/src/video/videoframe.cpp +++ b/src/video/videoframe.cpp @@ -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(pixelFormat), dataAlignment); } else {