Skip to content

Commit 993cd71

Browse files
quariumcmassiot
authored andcommitted
zoneplate: fix integer overflow
1 parent 4d3e680 commit 993cd71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/upipe-filters/zoneplate/videotestsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ gst_video_test_src_zoneplate_8bit (uint8_t *data,
169169
/*second order */
170170
/*normalise x/y terms to rate of change of phase at the picture edge */
171171
/*phase = phase + ((v->kx2 * x * x)/w) + ((v->ky2 * y * y)/h) + ((v->kt2 * t * t)>>1); */
172-
phase = phase + ((KX2 * x * x * scale_kx2) >> 16) + ky2 + (kt2 >> 1);
172+
phase = phase + (((unsigned)KX2 * x * x * scale_kx2) >> 16) + ky2 + (kt2 >> 1);
173173

174174
data[j*stride + i] = sine_table[phase & 0xff];
175175
}

0 commit comments

Comments
 (0)