bool-compare warning saptype > 2

RESOLVED FIXED in Firefox 45

Status

()

Core
Audio/Video: Playback
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rillian, Assigned: rillian)

Tracking

Trunk
mozilla45
Points:
---

Firefox Tracking Flags

(firefox44 affected, firefox45 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

0:03.61 /home/giles/mozilla/firefox/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp:2194:29: warning: comparison of constant ‘2’ with boolean expression is always false [-Wbool-compare]
 0:03.61          if (!sap || saptype > 2) {
 0:03.61                              ^
(Assignee)

Comment 1

3 years ago
Created attachment 8680297 [details] [diff] [review]
Fix stagefright comparison warning
Attachment #8680297 - Flags: review?(gsquelart)
Duplicate of this bug: 1153730
(Assignee)

Comment 3

3 years ago
Created attachment 8680317 [details] [diff] [review]
Fix stagefright comparison warning v2

Oops, remove unrelated changes from the patch.
Attachment #8680297 - Attachment is obsolete: true
Attachment #8680297 - Flags: review?(gsquelart)
Attachment #8680317 - Flags: review?(gsquelart)
Comment on attachment 8680317 [details] [diff] [review]
Fix stagefright comparison warning v2

Review of attachment 8680317 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with proper masking.

::: media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp
@@ +2190,4 @@
>              ALOGW("sub-sidx boxes not supported yet");
>          }
>          bool sap = d3 & 0x80000000;
> +        uint32_t saptype = d3 >> 28;

As discussed, you should mask the value to exclude the left-most bit (which should be a 1 in most cases), i.e.:
  (d3 >> 28) & 0x3
Attachment #8680317 - Flags: review?(gsquelart) → review+
(Assignee)

Comment 5

3 years ago
Created attachment 8680496 [details] [diff] [review]
Fix stagefright comparison warning v3

Add missing mask. Carrying forward r=gerald.
Attachment #8680317 - Attachment is obsolete: true
Attachment #8680496 - Flags: review+

Comment 7

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/59d9b597bafa
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45

Comment 8

3 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/59d9b597bafa
status-b2g-v2.5: --- → fixed
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
status-b2g-v2.5: fixed → ---
You need to log in before you can comment on or make changes to this bug.