[FFmpeg-cvslog] r12920 - trunk/libavformat/raw.c
andoma
subversion
Mon Apr 21 17:20:53 CEST 2008
Author: andoma
Date: Mon Apr 21 17:20:53 2008
New Revision: 12920
Log:
Compute AC3 frame CRC for stronger raw AC3 format probing.
Closes issue64.
Modified:
trunk/libavformat/raw.c
Modified: trunk/libavformat/raw.c
==============================================================================
--- trunk/libavformat/raw.c (original)
+++ trunk/libavformat/raw.c Mon Apr 21 17:20:53 2008
@@ -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 @@ static int ac3_probe(AVProbeData *p)
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);
More information about the ffmpeg-cvslog
mailing list