mirror of https://git.ffmpeg.org/ffmpeg.git
avdevice/lavfi: Use avio_closep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eb3e661bab
commit
e5993aeb60
|
@ -147,7 +147,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
|
||||||
goto end;
|
goto end;
|
||||||
av_bprint_init(&graph_file_pb, 0, AV_BPRINT_SIZE_UNLIMITED);
|
av_bprint_init(&graph_file_pb, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||||
ret = avio_read_to_bprint(avio, &graph_file_pb, INT_MAX);
|
ret = avio_read_to_bprint(avio, &graph_file_pb, INT_MAX);
|
||||||
avio_close(avio);
|
avio_closep(&avio);
|
||||||
av_bprint_chars(&graph_file_pb, '\0', 1);
|
av_bprint_chars(&graph_file_pb, '\0', 1);
|
||||||
if (!ret && !av_bprint_is_complete(&graph_file_pb))
|
if (!ret && !av_bprint_is_complete(&graph_file_pb))
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
|
Loading…
Reference in New Issue