Always-true assertion in media/libstagefright/binding/H264.cpp

RESOLVED FIXED in Firefox 53

Status

()

Core
Audio/Video: Playback
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: jseward, Assigned: alwu)

Tracking

Trunk
mozilla53
Points:
---

Firefox Tracking Flags

(firefox53 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

10 months ago
Spotted while building with gcc 6:

8:40.55 /home/sewardj/MOZ/MC-TALL/media/libstagefright/binding/H264.cpp:734:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
 8:40.55    NS_ASSERTION(numPps <= MAX_PPS_COUNT, "Exceed the maximum PPS counts!");

numPps is a uint8_t, and MAX_PPS_COUNT is 256.

I'm not sure what was intended here.
Alastor, you introduced this in bug 1321164.
Should be easy to fix using jya's READUE macro from bug 1322961.
Assignee: nobody → alwu
Blocks: 1321164
Sorry, didn't notice this error. 

Since we read 8 bits from extradata, the value would never exceed MAX_SPS/PPS_COUNT (256). I want to directly remove these assertions.

BTW, the bug 1322961 is used for BitReader, not ByteReader.
Comment hidden (mozreview-request)

Comment 4

10 months ago
mozreview-review
Comment on attachment 8828260 [details]
Bug 1332199 - remove always-true assertion.

https://reviewboard.mozilla.org/r/105732/#review106618

Even simpler than I thought!
Thank you for taking care of this so quickly.
Attachment #8828260 - Flags: review?(gsquelart) → review+

Comment 5

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/fb351cbb958a
Status: NEW → RESOLVED
Last Resolved: 10 months ago
status-firefox53: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.