Commit 43991dbd authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 8e53233f
......@@ -63,8 +63,8 @@ static int write_header(AVFormatContext *s)
if (trailer)
trailer = strstr(trailer, "\n");
if (trailer++) {
header_size = (trailer - par->extradata);
if (trailer) {
header_size = (++trailer - par->extradata);
ass->trailer_size = par->extradata_size - header_size;
if (ass->trailer_size)
ass->trailer = trailer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment