lafv/wavdec: Fail bext parsing on incomplete reads
authorMatt Wolenetz <wolenetz@google.com>
Thu, 25 Jul 2019 22:54:49 +0000 (15:54 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 4 Aug 2019 19:16:28 +0000 (21:16 +0200)
commit907027a4f26d6df9a773afd6d92dd88c51822906
treeef738ad9fdf4f573c4414fd70677958f53a7da43
parent9cb0da0bfef9d751b5f72779d7f20dab6dd98b86
lafv/wavdec: Fail bext parsing on incomplete reads

avio_read can successfully return even when less than the requested
amount of input was read. wavdec's bext parsing mistakenly assumed a
successful avio_read always read the full amount that was requested.
The result could be dictionary tags populated with partially
uninitialized values.

This change also fixes a broken assertion in wav_parse_bext_string that
was off-by-one, though no known current usage of that method hits that
broken case.

Chromium bug: 987270

Signed-off-by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 052d41377a02f480f8e7135c0f7d418e9a405215)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/wavdec.c