diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2021-12-25 11:15:40 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2022-01-30 13:26:35 +0800 |
commit | c825de87c95ac4c70b9495268fcd26bd10dd0027 (patch) | |
tree | 9792d4f9930f379ce787f374cca8eb36c7fd1410 /libavformat/rtpdec_mpeg4.c | |
parent | d9f05bea5cc7a8c4bb0569eecbe24a26def7f476 (diff) | |
download | ffmpeg-c825de87c95ac4c70b9495268fcd26bd10dd0027.tar.gz |
avformat/rtpdec: return value check for init_get_bits()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/rtpdec_mpeg4.c')
-rw-r--r-- | libavformat/rtpdec_mpeg4.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |