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. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
40a3d35da6
commit
a17596f55b
1 changed files with 1 additions and 1 deletions
|
|
@ -1006,7 +1006,7 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f)
|
||||||
|
|
||||||
ret = allocate_3dlut(ctx, size, prelut);
|
ret = allocate_3dlut(ctx, size, prelut);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto end;
|
||||||
|
|
||||||
for (int k = 0; k < size; k++) {
|
for (int k = 0; k < size; k++) {
|
||||||
for (int j = 0; j < size; j++) {
|
for (int j = 0; j < size; j++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue