Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 9ee65bf

Browse files
committed
avformat/sdp: Fix potential write beyond end of buffer
Reviewed-by: Michael Niedermayer <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit 5d91b77) Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent be84216 commit 9ee65bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavformat/sdp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static char *extradata2psets(AVFormatContext *s, AVCodecParameters *par)
212212
p += strlen(p);
213213
r = r1;
214214
}
215-
if (sps && sps_end - sps >= 4) {
215+
if (sps && sps_end - sps >= 4 && p - psets <= MAX_PSET_SIZE - strlen(profile_string) - 7) {
216216
memcpy(p, profile_string, strlen(profile_string));
217217
p += strlen(p);
218218
ff_data_to_hex(p, sps + 1, 3, 0);

0 commit comments

Comments
 (0)