Commit 862163e5 authored by Tristan Matthews's avatar Tristan Matthews

configure: add --disable-crc option

Useful for fuzzing
parent c1daa80c
......@@ -150,6 +150,17 @@ if test -z "$SIZE64"; then
AC_MSG_WARN(No 64 bit type found on this platform!)
fi
AC_ARG_ENABLE([crc],
[AS_HELP_STRING([--disable-crc],
[Disable CRC in the demuxer)])],,
[enable_crc=yes])
AM_CONDITIONAL([DISABLE_CRC], [test "$enable_crc" = "no"])
AS_IF([test "$enable_crc" = "no"],[
AC_DEFINE([DISABLE_CRC], [1], [Do not build with CRC])
])
dnl Checks for library functions.
AC_FUNC_MEMCMP
......
......@@ -20,6 +20,10 @@
********************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <limits.h>
#include <string.h>
......@@ -723,8 +727,10 @@ long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){
/* replace the computed checksum with the one actually read in */
memcpy(page+22,chksum,4);
#ifndef DISABLE_CRC
/* Bad checksum. Lose sync */
goto sync_fail;
#endif
}
}
......@@ -1814,6 +1820,7 @@ int main(void){
test_pack(packets,headret,0,0,0);
}
#ifndef DISABLE_CRC
{
/* test for the libogg 1.1.1 resync in large continuation bug
found by Josh Coalson) */
......@@ -1823,6 +1830,9 @@ int main(void){
fprintf(stderr,"testing continuation resync in very large packets... ");
test_pack(packets,headret,100,2,3);
}
#else
fprintf(stderr,"Skipping continuation resync test due to --disable-crc\n");
#endif
{
/* term only page. why not? */
......@@ -2084,6 +2094,7 @@ int main(void){
fprintf(stderr,"ok.\n");
}
#ifndef DISABLE_CRC
/* Test recapture: page + garbage + page */
{
ogg_page og_de;
......@@ -2125,6 +2136,9 @@ int main(void){
fprintf(stderr,"ok.\n");
}
#else
fprintf(stderr,"Skipping recapture test due to --disable-crc\n");
#endif
/* Free page data that was previously copied */
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment