diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-13 02:31:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-15 12:30:40 +0100 |
commit | 90c2256ee52ca69ff16bf1d2f831a2ef8d6064eb (patch) | |
tree | 2e087d95298ecd4cc2673b4b1af7bd2f449b29e2 /libavformat | |
parent | f459afdd7247b2803c615ec58cf7e642778245ed (diff) | |
download | ffmpeg-90c2256ee52ca69ff16bf1d2f831a2ef8d6064eb.tar.gz |
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: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 115fb6d03ef6310732b42258d8c3cd1839cfb74b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aviobuf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 1b3d5f5b80..4e79e3f917 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -360,6 +360,8 @@ static inline int put_str16(AVIOContext *s, const char *str, const int be) invalid: av_log(s, AV_LOG_ERROR, "Invaid UTF8 sequence in avio_put_str16%s\n", be ? "be" : "le"); err = AVERROR(EINVAL); + if (!*(q-1)) + break; } if (be) avio_wb16(s, 0); |