diff mbox series

[FFmpeg-devel,2/2] avdevice/lavfi: Don't unnecessarily write '\0' to AVBPrint

Message ID AM7PR03MB6660EC6042A8988564AFD9178F699@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 84f037edc2065db348879a9312720a93e54a4942
Headers show
Series [FFmpeg-devel,1/2] avdevice/lavfi: Properly free an AVDictionary | expand


Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 2, 2021, 4:16 p.m. UTC
An AVBPrint's internal string is always already zero-terminated;
writing another '\0' is unnecessary as long as one treats
the string only as a C-string.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavdevice/lavfi.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series


diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index d9083ad984..2659c8508a 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -156,9 +156,6 @@  av_cold static int lavfi_read_header(AVFormatContext *avctx)
         av_bprint_init(&graph_file_pb, 0, AV_BPRINT_SIZE_UNLIMITED);
         ret = avio_read_to_bprint(avio, &graph_file_pb, INT_MAX);
-        av_bprint_chars(&graph_file_pb, '\0', 1);
-        if (!ret && !av_bprint_is_complete(&graph_file_pb))
-            ret = AVERROR(ENOMEM);
         if (ret) {
             av_bprint_finalize(&graph_file_pb, NULL);
             goto end;