mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
Fix invalid memory read.
This commit is contained in:
parent
3e5301cce2
commit
0dc25b86e2
|
@ -1016,12 +1016,13 @@ static void intra_recon_tb_leaf(
|
|||
// Extra reference lines for use with MRL. Extra lines needed only for left edge.
|
||||
kvz_pixel extra_refs[2 * 128 * MAX_REF_LINE_IDX] = { 0 };
|
||||
|
||||
if (x > 0 && lcu_px.x == 0) {
|
||||
if (x > 0 && lcu_px.x == 0 && lcu_px.y > 0) {
|
||||
videoframe_t* const frame = state->tile->frame;
|
||||
|
||||
// Copy ref lines 2 & 3. Line 1 is stored in LCU ref buffers.
|
||||
for (int i = 0; i < MAX_REF_LINE_IDX; ++i) {
|
||||
int height = (LCU_WIDTH >> depth) * 2 + MAX_REF_LINE_IDX;
|
||||
height = MIN(height, pic_px.y - (y - MAX_REF_LINE_IDX));
|
||||
kvz_pixels_blit(&frame->rec->y[(y - MAX_REF_LINE_IDX) * frame->rec->stride + x - (1 + i)],
|
||||
&extra_refs[i * 2 * 128],
|
||||
1, height,
|
||||
|
|
|
@ -1056,12 +1056,13 @@ void kvz_search_cu_intra(encoder_state_t * const state,
|
|||
// Extra reference lines for use with MRL. Extra lines needed only for left edge.
|
||||
kvz_pixel extra_refs[2 * 128 * MAX_REF_LINE_IDX] = {0};
|
||||
|
||||
if (x_px > 0 && lcu_px.x == 0) {
|
||||
if (x_px > 0 && lcu_px.x == 0 && lcu_px.y > 0) {
|
||||
videoframe_t* const frame = state->tile->frame;
|
||||
|
||||
// Copy extra ref lines, including ref line 1 and top left corner.
|
||||
for (int i = 0; i < MAX_REF_LINE_IDX; ++i) {
|
||||
int height = (LCU_WIDTH >> depth) * 2 + MAX_REF_LINE_IDX;
|
||||
int height = (LCU_WIDTH >> depth) * 2 + MAX_REF_LINE_IDX;
|
||||
height = MIN(height, pic_px.y - (y_px - MAX_REF_LINE_IDX));
|
||||
kvz_pixels_blit(&frame->rec->y[(y_px - MAX_REF_LINE_IDX) * frame->rec->stride + x_px - (1 + i)],
|
||||
&extra_refs[i * 2 * 128],
|
||||
1, height,
|
||||
|
|
Loading…
Reference in a new issue