avcodec: move end zeroing code from av_packet_split_side_data() to avcodec_decode_sub...
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 21 Nov 2013 01:32:37 +0000 (02:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Dec 2013 00:05:47 +0000 (01:05 +0100)
commitae81a0e32de6fa53a2670fe0dbb5d2a252030281
tree945715c6c1ffca0d7cafab9ecac89f4d0cbff546
parent4f93400db1f21f65a94777f0b13b0f1b336e41fc
avcodec: move end zeroing code from av_packet_split_side_data() to avcodec_decode_subtitle2()

This code changes the input packet, which is read only and can in
rare circumstances lead to decoder errors. (i run into one of these in
the audio decoder, which corrupted the packet during av_find_stream_info()
so that actual decoding that single packet failed later)
Until a better fix is implemented, this commit limits the problem.
A better fix might be to make the subtitle decoders not depend on
data[size] = 0 or to copy their input when this is not the case.
(cherry picked from commit 01923bab98506b1e98b4cbf08419364ce6ffea6d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/avpacket.c
libavcodec/utils.c