summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Öman <andreas@lonelycoder.com>2008-04-21 15:20:53 +0000
committerAndreas Öman <andreas@lonelycoder.com>2008-04-21 15:20:53 +0000
commitc675ef70253bdb8ad44d71198ff98be5474b85ee (patch)
tree5909b8572269edfe2cf139b6adb60bf2e2cc88ff /libavformat
parent66824f990bfc821a1daee58d7abfb556cc93fff7 (diff)
downloadffmpeg-c675ef70253bdb8ad44d71198ff98be5474b85ee.tar.gz
Compute AC3 frame CRC for stronger raw AC3 format probing.
Closes issue64. Originally committed as revision 12920 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/raw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c
index c860b7f54e..5c188dc92b 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -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);