Commit 10fac2e6 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: libmp4: fix zero length strings reading

parent 154cbf00
......@@ -105,6 +105,16 @@ static char *mp4_getstringz( uint8_t **restrict in, uint64_t *restrict size )
{
assert( *size <= SSIZE_MAX );
if( *size == 0 )
return NULL;
if( *in == 0 ) /* Null string stored */
{
*in += 1;
*size -= 1;
return NULL;
}
size_t len = strnlen( (const char *)*in, *size );
if( len == 0 || len >= *size )
return NULL;
......
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