From 0da9e55e6322e752cca04cbec190b96cfdd41824 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 27 Feb 2008 12:06:05 +0000 Subject: [PATCH] Avoid access to uninitialized memory and mis-detection of DTS as a result. --- src/common/dts_common.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/dts_common.cpp b/src/common/dts_common.cpp index 512d94c6f..8e19bb583 100644 --- a/src/common/dts_common.cpp +++ b/src/common/dts_common.cpp @@ -453,8 +453,9 @@ detect_dts(const void *src_buf, cur_buf ^= 1; } - if (find_dts_header((const unsigned char *)buf[cur_buf], len, - &dtsheader) >= 0) { + int dst_buf_len = dts_14_16 ? (len * 7 / 8) : len; + + if (find_dts_header((const unsigned char *)buf[cur_buf], dst_buf_len, &dtsheader) >= 0) { is_dts = true; break; }