ividsp: prevent pointers from going outside and overreading.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
12038ab16d
commit
f9143d2407
@ -87,6 +87,13 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (x = 0, indx = 0; x < plane->width; x+=2, indx++) {
|
for (x = 0, indx = 0; x < plane->width; x+=2, indx++) {
|
||||||
|
if (x+2 >= plane->width) {
|
||||||
|
b0_ptr --;
|
||||||
|
b1_ptr --;
|
||||||
|
b2_ptr --;
|
||||||
|
b3_ptr --;
|
||||||
|
}
|
||||||
|
|
||||||
/* some values calculated in the previous iterations can */
|
/* some values calculated in the previous iterations can */
|
||||||
/* be reused in the next ones, so do appropriate copying */
|
/* be reused in the next ones, so do appropriate copying */
|
||||||
b2_1 = b2_2; // b2[x-1,y ] = b2[x, y ]
|
b2_1 = b2_2; // b2[x-1,y ] = b2[x, y ]
|
||||||
@ -174,10 +181,10 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
|
|||||||
|
|
||||||
back_pitch = -pitch;
|
back_pitch = -pitch;
|
||||||
|
|
||||||
b0_ptr += pitch;
|
b0_ptr += pitch + 1;
|
||||||
b1_ptr += pitch;
|
b1_ptr += pitch + 1;
|
||||||
b2_ptr += pitch;
|
b2_ptr += pitch + 1;
|
||||||
b3_ptr += pitch;
|
b3_ptr += pitch + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user