You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge pull request #987 from ArmstrongCN/bugfix/ffmpeg
fix av_image_alloc alignment && check allocation error
This commit is contained in:
@@ -1307,7 +1307,11 @@ bool FFmpegReader::GetAVFrame() {
|
||||
frameFinished = 1;
|
||||
packet_status.video_decoded++;
|
||||
|
||||
av_image_alloc(pFrame->data, pFrame->linesize, info.width, info.height, (AVPixelFormat)(pStream->codecpar->format), 1);
|
||||
// align 32 for simd
|
||||
if (av_image_alloc(pFrame->data, pFrame->linesize, info.width,
|
||||
info.height, (AVPixelFormat)(pStream->codecpar->format), 32) <= 0) {
|
||||
throw OutOfMemory("Failed to allocate image buffer", path);
|
||||
}
|
||||
av_image_copy(pFrame->data, pFrame->linesize, (const uint8_t**)next_frame->data, next_frame->linesize,
|
||||
(AVPixelFormat)(pStream->codecpar->format), info.width, info.height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user