matroska: don't overwrite string values until read/alloc was succesful.
authorRonald S. Bultje <rsbultje@gmail.com>
Sat, 25 Feb 2012 00:12:18 +0000 (16:12 -0800)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 25 Feb 2012 15:53:23 +0000 (07:53 -0800)
commitcd40c31ee9ad2cca6f3635950b002fd46be07e98
treec0037f41b90c0dfcf7b9d71fc57bb1b379755d0d
parent03ca0a5b3000d705aba86ea2184df47303851f65
matroska: don't overwrite string values until read/alloc was succesful.

This prevents certain tags with a default value assigned to them (as per
the EBML syntax elements) from ever being assigned a NULL value. Other
parts of the code rely on these being non-NULL (i.e. they don't check for
NULL before e.g. using the string in strcmp() or similar), and thus in
effect this prevents crashes when reading of such specific tags fails,
either because of low memory or because of targeted file corruption.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavformat/matroskadec.c