You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/assenc: Fix potential NULL + 1
Incrementing a NULL pointer is undefined behaviour, yet this is what would happen in case trailer were NULL before the check. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -63,8 +63,8 @@ static int write_header(AVFormatContext *s)
|
|||||||
if (trailer)
|
if (trailer)
|
||||||
trailer = strstr(trailer, "\n");
|
trailer = strstr(trailer, "\n");
|
||||||
|
|
||||||
if (trailer++) {
|
if (trailer) {
|
||||||
header_size = (trailer - par->extradata);
|
header_size = (++trailer - par->extradata);
|
||||||
ass->trailer_size = par->extradata_size - header_size;
|
ass->trailer_size = par->extradata_size - header_size;
|
||||||
if (ass->trailer_size)
|
if (ass->trailer_size)
|
||||||
ass->trailer = trailer;
|
ass->trailer = trailer;
|
||||||
|
Reference in New Issue
Block a user