[FFmpeg-cvslog] lavc/truehd_core: Initialize the last bytes of the output buffer.

Carl Eugen Hoyos git at videolan.org
Wed Mar 20 18:23:40 EET 2019


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Thu Feb 14 22:43:10 2019 +0100| [801d78f0d89867b7451798112265f735efa800ef] | committer: Carl Eugen Hoyos

lavc/truehd_core: Initialize the last bytes of the output buffer.

Avoids undeterministic output.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=801d78f0d89867b7451798112265f735efa800ef
---

 libavcodec/truehd_core_bsf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/truehd_core_bsf.c b/libavcodec/truehd_core_bsf.c
index be021af8e8..dd40e1e0c3 100644
--- a/libavcodec/truehd_core_bsf.c
+++ b/libavcodec/truehd_core_bsf.c
@@ -117,6 +117,8 @@ static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out)
         out->size -= reduce * 2;
         parity_nibble ^= out->size / 2;
 
+        if (out_size > 8)
+            AV_WN64(out->data + out_size - 8, 0);
         if (have_header) {
             memcpy(out->data + 4, in->data + 4, 28);
             out->data[16 + 4] = (out->data[16 + 4] & 0x0f) | (FFMIN(s->hdr.num_substreams, 3) << 4);



More information about the ffmpeg-cvslog mailing list