aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sdp.c
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 21:31:39 +0200
commitd359b750afcca74524a1d686d2413c41b21d8486 (patch)
treebd74b7e548820001bde4c0ea13ff72c37972997c /libavformat/sdp.c
parent40e049856e4f78f2a91d0f7b8b80915e87c59d04 (diff)
downloadffmpeg-d359b750afcca74524a1d686d2413c41b21d8486.tar.gz
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> (cherry picked from commit 5d91b7718efc581da8882a4e9bf2f5953e41adbf) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/sdp.c')
-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);