Opened 9 months ago

Closed 3 weeks ago

#13440 closed Bug Report - General (Invalid)

Uninitialized variable in HLSRingBuffer::ParseM3U8

Reported by: David Hampton Owned by: cpinkham
Priority: minor Milestone: 30.1
Component: MythTV - HTTP Streaming Version: v30-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The code uses an uninitialized variable while parsing the #EXT-X-VERSION tag. It creates a new variable 'version2' without assigning a value, and then passes that variable to two functions.

Change History (2)

comment:1 Changed 3 weeks ago by thebitpit

Please close this ticket as this is not a bug.

This is the code in question:

 else if (line.startsWith(QLatin1String("#EXT-X-VERSION")))
            {
                int version2;
                if (!M3U::ParseVersion(line, StreamURL(), version2))
                    return false;
                hls->SetVersion(version2);
            }

It does not need an initial value for version2 since version2 is passed by reference (see header file mythtv/mythtv/libs/libmythtv/HLS/m3u.h ):

bool ParseVersion(const QString& line, const QString& loc, int& version);

Variable version 2 is always set by ParseVersion unless it returns false, then SetVersion is not called.

This is not a bug.

comment:2 Changed 3 weeks ago by David Hampton

Resolution: Invalid
Status: newclosed
Note: See TracTickets for help on using tickets.