lavfi/pad: avoid buffer overflow in buffer_needs_copy()

Replace & with short-circuit &&.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
This commit is contained in:
Xi Wang 2013-03-09 22:39:32 -05:00 committed by Stefano Sabatini
parent 65fc80f012
commit 969e8d35b5
1 changed files with 1 additions and 1 deletions

View File

@ -300,7 +300,7 @@ static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf)
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 = s->draw.hsub[planes[j]];
uint8_t *start1 = frame->data[planes[j]];
uint8_t *end1 = start1 + (frame->height >> hsub1) *