mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-05 07:30:37 +00:00
avformat/sdp: Check before appending ","
Found by reviewing code related to CID1500301 String not null terminated
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5b82852519)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -195,6 +195,8 @@ static char *extradata2psets(AVCodecContext *c)
|
||||
continue;
|
||||
}
|
||||
if (p != (psets + strlen(pset_string))) {
|
||||
if (p - psets >= MAX_PSET_SIZE)
|
||||
goto fail_in_loop;
|
||||
*p = ',';
|
||||
p++;
|
||||
}
|
||||
@@ -204,6 +206,7 @@ static char *extradata2psets(AVCodecContext *c)
|
||||
}
|
||||
if (!av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r)) {
|
||||
av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
|
||||
fail_in_loop:
|
||||
av_free(psets);
|
||||
av_free(tmpbuf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user