From: Josh Coalson Date: Wed, 7 Mar 2007 05:36:43 +0000 (+0000) Subject: comments X-Git-Tag: 1.2.0~113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10a6840138ac52fe7868dbaa820094b4847938f4;p=platform%2Fupstream%2Fflac.git comments --- diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index f377080..e09db2f 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -2141,6 +2141,19 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) * Note that along the way as we read the header, we look for a sync * code inside. If we find one it would indicate that our original * sync was bad since there cannot be a sync code in a valid header. + * + * Three kinds of things can go wrong when reading the frame header: + * 1) We may have sync'ed incorrectly and not landed on a frame header. + * If we don't find a sync code, it can end up looking like we read + * a valid but unparseable header, until getting to the frame header + * CRC. Even then we could get a false positive on the CRC. + * 2) We may have sync'ed correctly but on an unparseable frame (from a + * future encoder). + * 3) We may be on a damaged frame which appears valid but unparseable. + * + * For all these reasons, we try and read a complete frame header as + * long as it seems valid, even if unparseable, up until the frame + * header CRC. */ /*