OSDN Git Service

avformat/tta: fix crash with corrupted files
authorwm4 <nfxjfg@googlemail.com>
Tue, 3 Feb 2015 13:41:10 +0000 (14:41 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Feb 2015 15:18:19 +0000 (16:18 +0100)
commit6e7f183ae632f160638203c4a9302c25f1bc7bc6
tree6bea72b48393f01f8c0af7f2b7bf32ab52b74e75
parent37723e0d0c3e9ac137ba53c2f02912a27ed97a7a
avformat/tta: fix crash with corrupted files

av_add_index_entry() can fail, for example because the parameters are
invalid, or because memory allocation fails. Check this; it can actually
happen with corrupted files.

The second hunk is just for robustness. Just in case functions like
ff_reduce_index() remove entries. (Not sure if this can actually
happen.)

Fixes ticket #4294.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a0cd529a35190d9374b0b26504e71857cd67b83)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/tta.c