replay: Check properly version number

0 as version was never used so don't allow it

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-11-04 12:41:10 +00:00
parent c6881ad1a0
commit d0f4910c1d

View File

@ -1416,7 +1416,7 @@ SpiceReplay *spice_replay_new(FILE *file, int nsurfaces)
spice_return_val_if_fail(file != NULL, NULL);
if (fscanf(file, "SPICE_REPLAY %u\n", &version) == 1) {
if (version > 1) {
if (version != 1) {
spice_warning("Replay file version unsupported");
return NULL;
}