mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
swscale: fix possible lut leak in adapt_colors()
adapt_colors() allocates a SwsLut3D before calling add_convert_pass(). If add_convert_pass() fails, the function returns without freeing the previously allocated lut. Free lut on that error path. Signed-off-by: Huihui_Huang <hhhuang@smu.edu.sg>
This commit is contained in:
@@ -702,8 +702,10 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, SwsFormat dst,
|
||||
SwsFormat tmp = src;
|
||||
tmp.format = fmt_in;
|
||||
ret = add_convert_pass(graph, &src, &tmp, input, &input);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
ff_sws_lut3d_free(&lut);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = ff_sws_lut3d_generate(lut, fmt_in, fmt_out, &map);
|
||||
|
||||
Reference in New Issue
Block a user