aboutsummaryrefslogtreecommitdiffstats
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:52:00 +0200
commit9ee65bf88d6a4ec9587ce119aeae148a190d9838 (patch)
tree88ba6af9b3e3a1f991f36e757b425d84727bf1ad
parentbe84216c53a4ed81573c82320e9c4a20e9b349d9 (diff)
downloadffmpeg-9ee65bf88d6a4ec9587ce119aeae148a190d9838.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>
-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);