#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "../GPMF_parser.h"
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
{
char * tmpbuf[4096];
GPMF_stream gs_stream;
if(GPMF_OK == GPMF_Init(&gs_stream, Data, Size))
{
uint32_t samples;
do
{
switch(GPMF_Key(&gs_stream))
{
case STR2FOURCC("ACCL"):
// Found accelerometer
samples = GPMF_Repeat(&gs_stream);
if(GPMF_OK == GPMF_ScaledData(&gs_stream, tmpbuf, 4096, 0, samples, GPMF_TYPE_FLOAT))
{ /* Process scaled values */ }
break;
case STR2FOURCC("cust"):
// Found my custom data
samples = GPMF_Repeat(&gs_stream);
if(GPMF_OK == GPMF_FormattedData(&gs_stream, tmpbuf, 4096, 0, samples))
{ /* Process raw formatted data -- unscaled */ }
break;
default: // if you don’t know the Key you can skip to the next
break;
}
} while (GPMF_OK == GPMF_Next(&gs_stream, GPMF_RECURSE_LEVELS)); // Scan through all GPMF data
}
return 0;
}
The text was updated successfully, but these errors were encountered:
Caused by
GPMF_parser.c:1023:27:if type not in
GPMF_SampleType,GPMF_SizeofTypewill return 0.Workaround:
UBSan Report:
Base64 encoded payload:
Fuzzer sourcecode:
The text was updated successfully, but these errors were encountered: