[Spice-devel] [PATCH v3 4/8] replay: Move error check

Jonathon Jongsma jjongsma at redhat.com
Tue Sep 20 16:01:38 UTC 2016


On Fri, 2016-09-16 at 12:32 +0100, Frediano Ziglio wrote:
> Do the check after replay_fscanf to make sure everything
> is fine before calling red_replay_compat_drawable or
> red_replay_native_drawable.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-replay-qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
> index a5b9553..5fcb243 100644
> --- a/server/red-replay-qxl.c
> +++ b/server/red-replay-qxl.c
> @@ -1063,10 +1063,10 @@ static QXLCompatDrawable
> *red_replay_compat_drawable(SpiceReplay *replay, uint32
>  
>  static QXLPHYSICAL red_replay_drawable(SpiceReplay *replay, uint32_t
> flags)
>  {
> +    replay_fscanf(replay, "drawable\n");
>      if (replay->error) {
>          return 0;
>      }
> -    replay_fscanf(replay, "drawable\n");

Same comment: check return value of replay_fscanf() instead?

Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


>      if (flags & QXL_COMMAND_FLAG_COMPAT) {
>          return
> QXLPHYSICAL_FROM_PTR(red_replay_compat_drawable(replay, flags));
>      } else {


More information about the Spice-devel mailing list