History

avfilter/vf_signature: Fix integer overflow in filter_frame()

Fixes: CID1403233 The second of the 2 changes may be unneeded but will help coverity

Michael Niedermayer committed 4 years ago

Commit dd604061 parent 73c0fd21 file · +2 −2Browse files

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

Unified · Split

libavfilter/vf_signature.c+2−2
@@ -219,7 +219,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 218 unmodified lines
219219 dw1 = inlink->w / 32;
220220 if (inlink->w % 32)
221221 dw2 = dw1 + 1;
222− denom = (sc->divide) ? dh1 * dh2 * dw1 * dw2 : 1;
222+ denom = (sc->divide) ? dh1 * (int64_t)dh2 * dw1 * dw2 : 1;
223223
224224 for (i = 0; i < 32; i++) {
225225 rowcount = 0;
@@ -245,7 +245,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 19 unmodified lines
245245 }
246246 }
247247
248− denom = (sc->divide) ? 1 : dh1 * dh2 * dw1 * dw2;
248+ denom = (sc->divide) ? 1 : dh1 * (int64_t)dh2 * dw1 * dw2;
249249
250250 for (i = 0; i < ELEMENT_COUNT; i++) {
251251 const ElemCat* elemcat = elements[i];

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