ffmpeg | branch: release/6.1 | Jiasheng Jiang <[email protected]> |
Sat Aug 2 23:28:48 2025 +0000| [9f7b46e6d9f17732712d936e57c9223319be4064] |
committer: Michael Niedermayer
examples: Add av_freep to avoid potential memory leak
Add av_freep() to free avio_ctx_buffer if avio_alloc_context fails
to avoid potential memory leak.
Fixes: 5fc4dea39c ("examples: add avio_reading.c example")
Signed-off-by: Jiasheng Jiang <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 9ca58424ded24e931fed329174c28244b67d5670)
Signed-off-by: Michael Niedermayer <[email protected]>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f7b46e6d9f17732712d936e57c9223319be4064
---
doc/examples/avio_read_callback.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/doc/examples/avio_read_callback.c
b/doc/examples/avio_read_callback.c
index 4cf81ad72e..aa4a5c5b85 100644
--- a/doc/examples/avio_read_callback.c
+++ b/doc/examples/avio_read_callback.c
@@ -95,6 +95,7 @@ int main(int argc, char *argv[])
avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size,
0, &bd, &read_packet, NULL, NULL);
if (!avio_ctx) {
+ av_freep(&avio_ctx_buffer);
ret = AVERROR(ENOMEM);
goto end;
}
_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".