diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2013-10-13 21:47:10 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-10-13 21:51:52 +0800 |
commit | 6a64f5221d66a1499bf8df39a283fef7522621aa (patch) | |
tree | bd40f9c8eb0a4d9a633dd5c9acb7830948102483 | |
parent | 40581a99721dd0079e7e183afd2b82f0e3f91ec2 (diff) | |
download | gsoc2013-libgnome-autoar-6a64f5221d66a1499bf8df39a283fef7522621aa.tar.gz gsoc2013-libgnome-autoar-6a64f5221d66a1499bf8df39a283fef7522621aa.tar.zst gsoc2013-libgnome-autoar-6a64f5221d66a1499bf8df39a283fef7522621aa.zip |
AutoarExtract: Prevent priv->size == 0
This prevent "progress" signal from dividing number by zero.
-rw-r--r-- | gnome-autoar/autoar-extract.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gnome-autoar/autoar-extract.c b/gnome-autoar/autoar-extract.c index 315c855..faf8f39 100644 --- a/gnome-autoar/autoar-extract.c +++ b/gnome-autoar/autoar-extract.c @@ -1814,6 +1814,11 @@ autoar_extract_step_scan_toplevel (AutoarExtract *arextract) return; } + /* If we are unable to determine the total size, set it to a positive + * number to prevent strange percentage. */ + if (priv->size <= 0) + priv->size = G_MAXUINT64; + g_free (pathname_prefix); archive_read_free (a); |