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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -1006,7 +1006,7 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f) · 1005 unmodified lines | ||
| 1006 | 1006 | |
| 1007 | 1007 | ret = allocate_3dlut(ctx, size, prelut); |
| 1008 | 1008 | if (ret < 0) |
| 1009 | − return ret; | |
| 1009 | + goto end; | |
| 1010 | 1010 | |
| 1011 | 1011 | for (int k = 0; k < size; k++) { |
| 1012 | 1012 | for (int j = 0; j < size; j++) { |