replay: Move error check

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@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-09-15 18:24:17 +01:00
parent 6c5ea7311a
commit 0e5464f152

View File

@ -1066,10 +1066,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");
if (flags & QXL_COMMAND_FLAG_COMPAT) {
return QXLPHYSICAL_FROM_PTR(red_replay_compat_drawable(replay, flags));
} else {