From b9d7a3c82c160c8871c9f9effbc0a91c0d42fd53 Mon Sep 17 00:00:00 2001 From: Lorenzo Desole Date: Sun, 20 Mar 2011 20:03:30 +0100 Subject: Check that we've found both AAC signatures demux_aac.c looks for 2 signatures in the given stream to detect if it is an AAC stream, however only the absence of the second signature is used to rule out a positive match. This may lead to false positives. --- src/demuxers/demux_aac.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c index 6615f4f61..0ac645b78 100644 --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -122,6 +122,10 @@ static int open_aac_file(demux_aac_t *this) { syncword = (syncword << 8) | peak[i]; } + /* did we really find the ADTS header? */ + if (i == MAX_PREVIEW_SIZE) + return 0; /* No, we didn't */ + /* Look for second ADTS header to confirm it's really aac */ if (data_start + 5 < MAX_PREVIEW_SIZE) { int frame_size = ((peak[data_start+3] & 0x03) << 11) | -- cgit v1.2.3