[FFmpeg-cvslog] avformat/rtpdec_latm: fix leak in parse_fmtp_config()
Lidong Yan
git at videolan.org
Fri Jul 4 00:07:59 EEST 2025
ffmpeg | branch: master | Lidong Yan <yldhome2d2 at gmail.com> | Sun Jun 29 14:45:23 2025 +0800| [7ed5a7094fe6430e9295424623e740dd57873a6e] | committer: Michael Niedermayer
avformat/rtpdec_latm: fix leak in parse_fmtp_config()
av_mallocz() allocates memory in config, but we forget to free it
if init_get_bits() failed. Replace return ret with goto end.
Signed-off-by: Lidong Yan <502024330056 at smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ed5a7094fe6430e9295424623e740dd57873a6e
---
libavformat/rtpdec_latm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c
index 2b4478289e..74523c167d 100644
--- a/libavformat/rtpdec_latm.c
+++ b/libavformat/rtpdec_latm.c
@@ -104,7 +104,7 @@ static int parse_fmtp_config(AVStream *st, const char *value)
ff_hex_to_data(config, value);
ret = init_get_bits(&gb, config, len*8);
if (ret < 0)
- return ret;
+ goto end;
audio_mux_version = get_bits(&gb, 1);
same_time_framing = get_bits(&gb, 1);
skip_bits(&gb, 6); /* num_sub_frames */
More information about the ffmpeg-cvslog
mailing list