History

avfilter/asrc_sine: Fix invalid left shift of negative number

by using a multiplication instead. The multiplication can never overflow an int because the sin-factor is only an int16_t. Affected the FATE-tests filter-concat and filter-concat-vfr.

Andreas Rheinhardt committed 6 years ago

Commit 55b46901 parent a42c47b1 file · +1 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/asrc_sine.c+1−1
@@ -247,7 +247,7 @@ static int request_frame(AVFilterLink *outlink) · 246 unmodified lines
247247 samples[i] = sine->sin[sine->phi >> (32 - LOG_PERIOD)];
248248 sine->phi += sine->dphi;
249249 if (sine->beep_index < sine->beep_length) {
250− samples[i] += sine->sin[sine->phi_beep >> (32 - LOG_PERIOD)] << 1;
250+ samples[i] += sine->sin[sine->phi_beep >> (32 - LOG_PERIOD)] * 2;
251251 sine->phi_beep += sine->dphi_beep;
252252 }
253253 if (++sine->beep_index == sine->beep_period)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t