Closed Bug 949360 Opened 8 years ago Closed 8 years ago

Check for Image AllocateBuffer() failures

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29
Tracking Status
firefox27 --- wontfix
firefox28 --- fixed
firefox29 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

This patch began as a fix for a warning that local variable `status` was unused in release builds:

gfx/layers/ipc/SharedPlanarYCbCrImage.cpp:133:8 [-Wunused-variable] unused variable 'status'

But then I saw that a couple Image functions did not check whether AllocateBuffer() returned null. This patch checks for AllocateBuffer() returning null and also avoids setting mBufferSize to a non-zero size when mBuffer is null.

Green try run:
https://tbpl.mozilla.org/?tree=Try&rev=1598ed0935bc
Attachment #8346423 - Flags: review?(nical.bugzilla)
Duplicate of this bug: 949359
Attachment #8346423 - Flags: review?(nical.bugzilla) → review+
Backed out because of mochitest-3 timeouts:

http://hg.mozilla.org/integration/mozilla-inbound/rev/7631ae46b853
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=6d9cf51a012a

Note that the WinXP mochitest-3 crashes were probably caused by bug 948777.
https://hg.mozilla.org/mozilla-central/rev/6f419c7c2873
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Comment on attachment 8346423 [details] [diff] [review]
handle-AllocateBuffer-failure.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Not a regression, just some omitted error checks
User impact if declined: No big problems. These error checks have been missing for a couple releases without causing any major problems.
Testing completed (on m-c, etc.): m-c for one week
Risk to taking this patch (and alternatives if risky): Low risk. It just adds a couple error checks for failed allocations of graphics buffer allocation.
String or IDL/UUID changes made by this patch: None
Attachment #8346423 - Flags: approval-mozilla-aurora?
Attachment #8346423 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.