# HG changeset patch # User andoma # Date 1208791253 0 # Node ID 4fa7ec10b57e7816604766be37a16c6164304ec1 # Parent 57baf1166899e512dff241adf80ceaec0af56d4c Compute AC3 frame CRC for stronger raw AC3 format probing. Closes issue64. diff -r 57baf1166899 -r 4fa7ec10b57e raw.c --- a/raw.c Mon Apr 21 08:19:16 2008 +0000 +++ b/raw.c Mon Apr 21 15:20:53 2008 +0000 @@ -22,6 +22,7 @@ #include "avformat.h" #include "ac3_parser.h" #include "raw.h" +#include "crc.h" #ifdef CONFIG_MUXERS /* simple formats */ @@ -429,6 +430,9 @@ for(frames = 0; buf2 < end; frames++) { if(ff_ac3_parse_header(buf2, &hdr) < 0) break; + if(buf2 + hdr.frame_size > end || + av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2)) + break; buf2 += hdr.frame_size; } max_frames = FFMAX(max_frames, frames);