[Spice-devel] [server] streaming: Don't start streaming if there is no video encoder
Christophe Fergeau
cfergeau at redhat.com
Wed Jul 27 09:15:12 UTC 2016
On Mon, Jul 25, 2016 at 06:37:00PM +0200, Francois Gouget wrote:
> On Sun, 24 Jul 2016, Uri Lublin wrote:
> [...]
> > This patch prevents a crash as few lines below there is access
> > to agent->video_encoder->codec_type.
> >
> > I think it would be better to make the check it in
> > dcc_create_stream(), and replace the patch here to assert.
>
> I think it makes more sense to have it this way.
I agree, we could add more checks in dcc_create_stream() if we want, but
looking thhrough the code, most dereferences of agent->video_encoder are
protected by a NULL check. The marshalling code is one of the few places
where it's not done, so adding it here makes sense for consistency
reasons.
If a later patch adds more magic to dcc_create_stream(), we can look
which agent->video_encoder NULL checks should be replaced with
g_return_if_fail() or similar.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160727/18f50048/attachment.sig>
More information about the Spice-devel
mailing list