Avoid buffer overflow in buffer_needs_copy()
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
return 1;
#define SIGN(x) ((x) > 0 ? 1 : -1)
- for (j = 0; j < FF_ARRAY_ELEMS(planes) & planes[j] >= 0; j++) {
+ for (j = 0; j < FF_ARRAY_ELEMS(planes) && planes[j] >= 0; j++) {
int hsub1 = (planes[j] == 1 || planes[j] == 2) ? s->hsub : 0;
uint8_t *start1 = frame->data[planes[j]];
uint8_t *end1 = start1 + (frame->height >> hsub1) *