Fix encoder_state_init, which was making out of bound reads

This commit is contained in:
Laurent Fasnacht 2014-05-21 14:23:36 +02:00
parent 37c20b8ce5
commit 66e730ba94

View file

@ -1073,7 +1073,8 @@ int encoder_state_init(encoder_state * const child_state, encoder_state * const
//Find LCU above //Find LCU above
if (child_state->type == ENCODER_STATE_TYPE_WAVEFRONT_ROW) { if (child_state->type == ENCODER_STATE_TYPE_WAVEFRONT_ROW) {
int j; int j;
for (j=0; child_state->parent->children[j].encoder_control; ++j) { //For all previous wavefront rows
for (j=0; &child_state->parent->children[j] != child_state && child_state->parent->children[j].encoder_control; ++j) {
if (child_state->parent->children[j].wfrow->lcu_offset_y == child_state->wfrow->lcu_offset_y - 1) { if (child_state->parent->children[j].wfrow->lcu_offset_y == child_state->wfrow->lcu_offset_y - 1) {
int k; int k;
for (k=0; k < child_state->parent->children[j].lcu_order_count; ++k) { for (k=0; k < child_state->parent->children[j].lcu_order_count; ++k) {