Skip to content

Commit

Permalink
vcomp/cineform: fixed crashing RGB
Browse files Browse the repository at this point in the history
Together with the previous revert commit fixes CID 464437.

In addition to incorrect change to unsigned, also parenthesis around
(height - 1) were missing.
  • Loading branch information
MartinPulec committed Jul 2, 2024
1 parent 2b5a23f commit bee8b92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video_compress/cineform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,11 @@ static video_frame *get_copy(struct state_video_compress_cineform *s, video_fram
auto *dst = (unsigned char *) ret->tiles[0].data;
int dst_sign = 1;
if (s->precompress_desc.color_spec == RGB) { // upside down
dst += static_cast<size_t>(dst_linesize) * frame->tiles[0].height - 1;
dst += static_cast<size_t>(dst_linesize) *
(frame->tiles[0].height - 1);
dst_sign = -1;
}
for (long int i = 0; i < frame->tiles[0].height; ++i) {
for (long int i = 0; i < (long int) frame->tiles[0].height; ++i) {
s->dec(dst + dst_sign * i * dst_linesize, (unsigned char *) frame->tiles[0].data + i * src_linesize, dst_linesize, 16, 8, 0);
}

Expand Down

0 comments on commit bee8b92

Please sign in to comment.