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.
Unified · Split
| @@ -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++) { |