Avoid access to uninitialized memory and mis-detection of DTS as a result.

This commit is contained in:
Moritz Bunkus 2008-02-27 12:06:05 +00:00
parent b25973076b
commit 0da9e55e63

View File

@ -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;
}