In OpenMP4Source(), the following three variables are defined as signed 32 bit integers:
|
int32_t segment_duration; //integer that specifies the duration of this edit segment in units of the movie�s time scale. |
|
int32_t segment_mediaTime; //integer containing the starting time within the media of this edit segment(in media timescale units).If this field is set to �1, it is an empty edit.The last edit in a track should never be an empty edit.Any difference between the movie�s duration and the track�s duration is expressed as an implicit empty edit. |
|
int32_t segment_mediaRate; //point number that specifies the relative rate at which to play the media corresponding to this edit segment.This rate value cannot be 0 or negative. |
However, it appears that
- 32 bit of data is written into them via
fread() and values are shifted with <<24 via the BYTESWAP32 macro
- the represented values are (likely) only supposed to be positive
This can lead to undefined behaviour. Switching the int32_t to uint32_t might be a solution, but this should be checked by someone that is more familiar with the code.
In
OpenMP4Source(), the following three variables are defined as signed 32 bit integers:gpmf-parser/demo/GPMF_mp4reader.c
Lines 350 to 352 in 98aff12
However, it appears that
fread()and values are shifted with<<24via theBYTESWAP32macroThis can lead to undefined behaviour. Switching the
int32_ttouint32_tmight be a solution, but this should be checked by someone that is more familiar with the code.