diff mbox series

[FFmpeg-devel,3/4] avformat/amr: Don't reset AVFormatContext.priv_data

Message ID AM7PR03MB666096A595AE8F8DD23D89758F4C9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit a5a99cc11c7aea587c871d6ca3fc80d9f9828e27
Headers show
Series [FFmpeg-devel] avformat/Makefile: Add missing libamqp->urldecode dependency | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/make_loongarch64 fail Make failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 6, 2022, 10:52 a.m. UTC
The AMR muxer doesn't have a private context, so it's priv_data
will be NULL. If it weren't, simply setting it to NULL would lead
to a memleak.

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

Patch

diff --git a/libavformat/amr.c b/libavformat/amr.c
index 9250089cb1..8e14052200 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -53,8 +53,6 @@  static int amr_write_header(AVFormatContext *s)
     AVIOContext    *pb  = s->pb;
     AVCodecParameters *par = s->streams[0]->codecpar;
 
-    s->priv_data = NULL;
-
     if (par->codec_id == AV_CODEC_ID_AMR_NB) {
         avio_write(pb, AMR_header,   sizeof(AMR_header)   - 1); /* magic number */
     } else if (par->codec_id == AV_CODEC_ID_AMR_WB) {