History

avcodec/takdsp: Fix integer overflows

Fixes: avcodec/takdsp.c:44:23: runtime error: signed integer overflow: -2097158 - 2147012608 cannot be represented in type 'int' Fixes: 58417/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5268919664640000

Michael Niedermayer committed 3 years ago

Commit ff8a4961 parent adfe0031 file · +6 −6Browse files

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

Unified · Split

libavcodec/takdsp.c+6−6
@@ -28,8 +28,8 @@ static void decorrelate_ls(int32_t *p1, int32_t *p2, int length) · 27 unmodified lines
28 int i;28 int i;
29 29
30 for (i = 0; i < length; i++) {30 for (i = 0; i < length; i++) {
31 int32_t a = p1[i];31 uint32_t a = p1[i];
32 int32_t b = p2[i];32 uint32_t b = p2[i];
33 p2[i] = a + b;33 p2[i] = a + b;
34 }34 }
35}35}
@@ -39,8 +39,8 @@ static void decorrelate_sr(int32_t *p1, int32_t *p2, int length) · 3 unmodified lines
39 int i;39 int i;
40 40
41 for (i = 0; i < length; i++) {41 for (i = 0; i < length; i++) {
42 int32_t a = p1[i];42 uint32_t a = p1[i];
43 int32_t b = p2[i];43 uint32_t b = p2[i];
44 p1[i] = b - a;44 p1[i] = b - a;
45 }45 }
46}46}
@@ -50,7 +50,7 @@ static void decorrelate_sm(int32_t *p1, int32_t *p2, int length) · 3 unmodified lines
50 int i;50 int i;
51 51
52 for (i = 0; i < length; i++) {52 for (i = 0; i < length; i++) {
53 int32_t a = p1[i];53 uint32_t a = p1[i];
54 int32_t b = p2[i];54 int32_t b = p2[i];
55 a -= b >> 1;55 a -= b >> 1;
56 p1[i] = a;56 p1[i] = a;
@@ -63,7 +63,7 @@ static void decorrelate_sf(int32_t *p1, int32_t *p2, int length, int dshift, int · 6 unmodified lines
63 int i;63 int i;
64 64
65 for (i = 0; i < length; i++) {65 for (i = 0; i < length; i++) {
66 int32_t a = p1[i];66 uint32_t a = p1[i];
67 int32_t b = p2[i];67 int32_t b = p2[i];
68 b = (unsigned)((int)(dfactor * (unsigned)(b >> dshift) + 128) >> 8) << dshift;68 b = (unsigned)((int)(dfactor * (unsigned)(b >> dshift) + 128) >> 8) << dshift;
69 p1[i] = b - a;69 p1[i] = b - a;

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