Coverage Report

Created: 2026-09-01 07:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vlc/modules/demux/mp4/minibox.h
Line
Count
Source
1
/*****************************************************************************
2
 * minibox.h: minimal mp4 box iterator
3
 *****************************************************************************
4
 * Copyright (C) 2017 VideoLabs, VLC authors and VideoLAN
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU Lesser General Public License as published by
8
 * the Free Software Foundation; either version 2.1 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License
17
 * along with this program; if not, write to the Free Software Foundation,
18
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19
 *****************************************************************************/
20
21
typedef struct
22
{
23
    const uint8_t *p_buffer;
24
    size_t i_buffer;
25
    const uint8_t *p_payload;
26
    size_t i_payload;
27
    vlc_fourcc_t i_type;
28
} mp4_box_iterator_t;
29
30
static void mp4_box_iterator_Init( mp4_box_iterator_t *p_it,
31
                                   const uint8_t *p_data, size_t i_data )
32
756k
{
33
756k
    p_it->p_buffer = p_data;
34
756k
    p_it->i_buffer = i_data;
35
756k
}
Unexecuted instantiation: webvtt.c:mp4_box_iterator_Init
subsvtt.c:mp4_box_iterator_Init
Line
Count
Source
32
756k
{
33
756k
    p_it->p_buffer = p_data;
34
756k
    p_it->i_buffer = i_data;
35
756k
}
Unexecuted instantiation: substx3g.c:mp4_box_iterator_Init
36
37
static bool mp4_box_iterator_Next( mp4_box_iterator_t *p_it )
38
3.01M
{
39
3.01M
    if( p_it->i_buffer > 8 )
40
2.25M
    {
41
2.25M
        const uint8_t *p = p_it->p_buffer;
42
2.25M
        const size_t i_size = GetDWBE( p );
43
2.25M
        p_it->i_type = VLC_FOURCC(p[4], p[5], p[6], p[7]);
44
2.25M
        if( i_size >= 8 && i_size <= p_it->i_buffer )
45
2.25M
        {
46
2.25M
            p_it->p_payload = &p_it->p_buffer[8];
47
2.25M
            p_it->i_payload = i_size - 8;
48
            /* update for next run */
49
2.25M
            p_it->p_buffer += i_size;
50
2.25M
            p_it->i_buffer -= i_size;
51
2.25M
            return true;
52
2.25M
        }
53
2.25M
    }
54
756k
    return false;
55
3.01M
}
Unexecuted instantiation: webvtt.c:mp4_box_iterator_Next
subsvtt.c:mp4_box_iterator_Next
Line
Count
Source
38
3.01M
{
39
3.01M
    if( p_it->i_buffer > 8 )
40
2.25M
    {
41
2.25M
        const uint8_t *p = p_it->p_buffer;
42
2.25M
        const size_t i_size = GetDWBE( p );
43
2.25M
        p_it->i_type = VLC_FOURCC(p[4], p[5], p[6], p[7]);
44
2.25M
        if( i_size >= 8 && i_size <= p_it->i_buffer )
45
2.25M
        {
46
2.25M
            p_it->p_payload = &p_it->p_buffer[8];
47
2.25M
            p_it->i_payload = i_size - 8;
48
            /* update for next run */
49
2.25M
            p_it->p_buffer += i_size;
50
2.25M
            p_it->i_buffer -= i_size;
51
2.25M
            return true;
52
2.25M
        }
53
2.25M
    }
54
756k
    return false;
55
3.01M
}
Unexecuted instantiation: substx3g.c:mp4_box_iterator_Next