From c825de87c95ac4c70b9495268fcd26bd10dd0027 Mon Sep 17 00:00:00 2001 From: Limin Wang Date: Sat, 25 Dec 2021 11:15:40 +0800 Subject: avformat/rtpdec: return value check for init_get_bits() Signed-off-by: Limin Wang --- libavformat/rtpdec_mpeg4.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat/rtpdec_mpeg4.c') diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c index 34c7950bcc..723b6fc6ed 100644 --- a/libavformat/rtpdec_mpeg4.c +++ b/libavformat/rtpdec_mpeg4.c @@ -124,6 +124,7 @@ static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf, int len) { int au_headers_length, au_header_size, i; GetBitContext getbitcontext; + int ret; if (len < 2) return AVERROR_INVALIDDATA; @@ -144,7 +145,9 @@ static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf, int len) if (len < data->au_headers_length_bytes) return AVERROR_INVALIDDATA; - init_get_bits(&getbitcontext, buf, data->au_headers_length_bytes * 8); + ret = init_get_bits(&getbitcontext, buf, data->au_headers_length_bytes * 8); + if (ret < 0) + return ret; /* XXX: Wrong if optional additional sections are present (cts, dts etc...) */ au_header_size = data->sizelength + data->indexlength; -- cgit v1.2.3