From 7aef2a74489946a74fdcf70a484a2b490b7e83ad Mon Sep 17 00:00:00 2001 From: Martin Piatka <445597@mail.muni.cz> Date: Thu, 7 Feb 2019 12:45:51 +0100 Subject: [PATCH] Fix BGR pixelformat block size --- src/shared_mem_frame.cpp | 1 + src/video_codec.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared_mem_frame.cpp b/src/shared_mem_frame.cpp index a16cd8a5e..6922ee70f 100644 --- a/src/shared_mem_frame.cpp +++ b/src/shared_mem_frame.cpp @@ -231,6 +231,7 @@ void Shared_mem::put_frame(struct video_frame *frame){ int src_line_len = vc_get_linesize(desc.width, frame->color_spec); int block_size = get_pf_block_size(frame->color_spec); + assert(block_size > 0); int dst = 0; for(unsigned y = 0; y < desc.height; y += scaleF){ for(int x = 0; x + scaleF * block_size <= src_line_len; x += scaleF * block_size){ diff --git a/src/video_codec.c b/src/video_codec.c index d0611f24d..8e25796ae 100644 --- a/src/video_codec.c +++ b/src/video_codec.c @@ -164,7 +164,7 @@ static const struct codec_info_t codec_info[] = { [VP9] = {"VP9", "Google VP9", to_fourcc('V','P','9','0'), 0, 1.0, 8, 0, FALSE, TRUE, TRUE, FALSE, "vp9"}, [BGR] = {"BGR", "Blue Green Red 24bit", - to_fourcc('B','G','R','2'), 1, 3.0, 8, 0, TRUE, FALSE, FALSE, FALSE, "bgr"}, + to_fourcc('B','G','R','2'), 1, 3.0, 8, 3, TRUE, FALSE, FALSE, FALSE, "bgr"}, [J2K] = {"J2K", "JPEG 2000", to_fourcc('M','J','2','C'), 0, 1.0, 8, 0, FALSE, TRUE, FALSE, FALSE, "j2k"}, [J2KR] = {"J2KR", "JPEG 2000 RGB",