matroskadec: Fix read-after-free in matroska_read_seek()
authorXiaohan Wang <xhwang@chromium.org>
Thu, 6 Nov 2014 20:59:54 +0000 (12:59 -0800)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 15 Dec 2014 14:46:34 +0000 (15:46 +0100)
commit490a3ebf36821b81f73e34ad3f554cb523dd2682
treec669f468faaaf86f5c73e3ebcd7ef9442f6679b3
parentd75190aa93206c02cb4f18a66d2c927d6a0198e1
matroskadec: Fix read-after-free in matroska_read_seek()

In matroska_read_seek(), |tracks| is assigned at the begining of the
function. However, functions like matroska_parse_cues() could reallocate
the tracks and invalidate |tracks|.

This assigns |tracks| only before using it, so that it will not get
invalidated elsewhere.

Bug-Id: chromium/427266
libavformat/matroskadec.c