Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 2617003003: Ensure internal_source is false for internal encoders. (Closed)

Created:
3 years, 11 months ago by noahric
Modified:
3 years, 11 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, the sun
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Ensure internal_source is false for internal encoders. webrtcvideoengine2.cc uses a field for parameters_, and doesn't empty out the current state in functions like SetCodec. In the case of internal_source, SetCodec only set it for external encoders, which means that in a switch from an internal-source external encoder to an internal encoder, the internal_source bit would stay set. (It's plausible that there are other places that are also unsafe and we just don't notice because codec switches are uncommon in most usage) In combination with https://codereview.webrtc.org/2574183002/, generic_encoder.cc now creates 1x1 uninitialized frames as fake frames for internal_source keyframe requests. The vp8 software encoder doesn't deal correctly with frames of resolutions that don't match the configured resolution (besides a DCHECK) and no longer throws these away (they used to be 0x0 frames), so this results in the VP8 encoder creating a keyframe of the configured send codec size by reading random memory off the end of the fake I420 frame. This could either cause crashes or encoding junk data, depending on where the allocation was. BUG=webrtc:6957 Review-Url: https://codereview.webrtc.org/2617003003 Cr-Commit-Position: refs/heads/master@{#15969} Committed: https://chromium.googlesource.com/external/webrtc/+/5d3b28b85393de3c9b81190bf6618966c3c2e227

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -0 lines) Patch
M webrtc/media/engine/webrtcvideoengine2.cc View 1 chunk +2 lines, -0 lines 2 comments Download

Messages

Total messages: 17 (10 generated)
noahric
3 years, 11 months ago (2017-01-05 20:46:17 UTC) #4
nisse-chromium (ooo August 14)
LGTM. https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvideoengine2.cc File webrtc/media/engine/webrtcvideoengine2.cc (right): https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvideoengine2.cc#newcode1772 webrtc/media/engine/webrtcvideoengine2.cc:1772: parameters_.config.encoder_settings.internal_source = false; Does this function now set ...
3 years, 11 months ago (2017-01-09 08:27:41 UTC) #8
magjed_webrtc
lgtm
3 years, 11 months ago (2017-01-09 10:10:38 UTC) #10
noahric
Thanks! https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvideoengine2.cc File webrtc/media/engine/webrtcvideoengine2.cc (right): https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvideoengine2.cc#newcode1772 webrtc/media/engine/webrtcvideoengine2.cc:1772: parameters_.config.encoder_settings.internal_source = false; On 2017/01/09 08:27:41, nisse-chromium wrote: ...
3 years, 11 months ago (2017-01-09 17:22:07 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2617003003/1
3 years, 11 months ago (2017-01-09 17:22:23 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/external/webrtc/+/5d3b28b85393de3c9b81190bf6618966c3c2e227
3 years, 11 months ago (2017-01-09 18:06:35 UTC) #16
nisse-webrtc
3 years, 11 months ago (2017-01-10 07:53:03 UTC) #17
Message was sent while issue was closed.
On 2017/01/09 17:22:07, noahric wrote:
> Thanks!
> 
>
https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvid...
> File webrtc/media/engine/webrtcvideoengine2.cc (right):
> 
>
https://codereview.webrtc.org/2617003003/diff/1/webrtc/media/engine/webrtcvid...
> webrtc/media/engine/webrtcvideoengine2.cc:1772:
> parameters_.config.encoder_settings.internal_source = false;
> On 2017/01/09 08:27:41, nisse-chromium wrote:
> > Does this function now set *all* attributes of
> > parameters_.config.encoder_settings?
> 
> I'm not sure, but that's probably a good question for mflodman@ or team to
take
> a pass over this code. I'd assume a safer pattern is to do something like
> parameters_.config.<stuff> = {0} at the start of this function.

I've had a look, and it seems all attributes are assigned (EncoderSettings
currently has the following five attributes: payload_name, payload_type,
internal_source, full_overuse_time, encoder).

Powered by Google App Engine
This is Rietveld 408576698