Closed Bug 1219475 Opened 9 years ago Closed 9 years ago

bool-compare warning saptype > 2

Categories

(Core :: Audio/Video: Playback, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox44 --- affected
firefox45 --- fixed

People

(Reporter: rillian, Assigned: rillian)

References

Details

Attachments

(1 file, 2 obsolete files)

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                              ^
Attachment #8680297 - Flags: review?(gsquelart)
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+
Add missing mask. Carrying forward r=gerald.
Attachment #8680317 - Attachment is obsolete: true
Attachment #8680496 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/59d9b597bafa
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: