summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-07 21:50:33 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-10 20:36:31 +0200
commit5d91b7718efc581da8882a4e9bf2f5953e41adbf (patch)
treee5123d60f97a5832cefad44e263b33c4a89569fa
parentec59dc73f0cc8930bf5dae389cd76d049d537ca7 (diff)
avformat/sdp: Fix potential write beyond end of buffer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/sdp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 34e9839b67..2ce1a62262 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -212,7 +212,7 @@ static char *extradata2psets(AVFormatContext *s, AVCodecParameters *par)
p += strlen(p);
r = r1;
}
- if (sps && sps_end - sps >= 4) {
+ if (sps && sps_end - sps >= 4 && p - psets <= MAX_PSET_SIZE - strlen(profile_string) - 7) {
memcpy(p, profile_string, strlen(profile_string));
p += strlen(p);
ff_data_to_hex(p, sps + 1, 3, 0);