Closed Bug 979812 Opened 10 years ago Closed 10 years ago

[MediaEncoder] VP8TrackEncoder::PrepareRawFrame should validate input image

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: u459114, Assigned: bechen)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Attach video track test case draft.

Test case crash at #61
91   EXPECT_TRUE(NS_FAILED(encoder.GetEncodedTrack(container)));

http://dxr.mozilla.org/mozilla-central/source/content/media/encoder/VP8TrackEncoder.cpp#265
We should call data->IsValid() to confirm this image data is ok for encoding.
OS: Linux → All
Hardware: x86_64 → All
If the data is invalid, should we treat it as a muted frame?
(In reply to Benjamin Chen [:bechen] from comment #1)
> If the data is invalid, should we treat it as a muted frame?
You can recover this error by turning that frame into muted(black frame) or just return error to the client side.
Unless we do encounter this problem in real use cases, I would suggest return error directly.
Attached patch bug-979812.patch (obsolete) — Splinter Review
Attachment #8387401 - Flags: review?(giles)
Comment on attachment 8387401 [details] [diff] [review]
bug-979812.patch

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

::: content/media/encoder/VP8TrackEncoder.cpp
@@ +290,5 @@
>      // Big-time assumption here that this is all contiguous data coming
>      // from getUserMedia or other sources.
>      MOZ_ASSERT(yuv);
> +    if (!yuv->IsValid()) {
> +      VP8LOG("PlanarYCbCrImage is not valid\n");

If this is something which shouldn't happen outside the unit test, NS_WARNING would be better here so it's more obvious when it goes wrong.

If sources can produce this in normal conditions, VP8LOG is better to avoid console spew.
Attachment #8387401 - Flags: review?(giles) → review+
Attached patch bug-979812.patchSplinter Review
r=rillian.
Change VP8LOG to NS_WARNING.
try server: https://tbpl.mozilla.org/?tree=Try&rev=c078c9c4fb19
Attachment #8387401 - Attachment is obsolete: true
Attachment #8392075 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/759f74aa389d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: