Commit a7dea6f2 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/aviobuf: Fix end check in put_str16()

Fixes out of array read
Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 115fb6d0)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8419971a
......@@ -358,6 +358,8 @@ int avio_put_str16le(AVIOContext *s, const char *str)
invalid:
av_log(s, AV_LOG_ERROR, "Invaid UTF8 sequence in avio_put_str16le\n");
err = AVERROR(EINVAL);
if (!*(q-1))
break;
}
avio_wl16(s, 0);
if (err)
......
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