History

avfilter/vf_lut3d: fix leak if allocate_3dlut failed

In parse_cinespace(), memory allocated in in_prelut[] and out_prelut[] would leak if allocate_3dlut() failed. Replace return ret with goto end to free memory before return error code.

Lidong Yan committed 1 year ago

Commit a17596f1 parent 40a3d351 file · +1 −1Browse files

Unified · Split

libavfilter/vf_lut3d.c+1−1
@@ -1006,7 +1006,7 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f) · 1005 unmodified lines
1006 1006
1007 ret = allocate_3dlut(ctx, size, prelut);1007 ret = allocate_3dlut(ctx, size, prelut);
1008 if (ret < 0)1008 if (ret < 0)
1009 return ret;1009 goto end;
1010 1010
1011 for (int k = 0; k < size; k++) {1011 for (int k = 0; k < size; k++) {
1012 for (int j = 0; j < size; j++) {1012 for (int j = 0; j < size; j++) {

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