Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
145b0573
Commit
145b0573
authored
Aug 31, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: avoid division by zero
If the downloaded file is empty or of unknown size.
parent
afceeaf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/misc/update.c
src/misc/update.c
+5
-4
No files found.
src/misc/update.c
View file @
145b0573
...
...
@@ -471,7 +471,7 @@ bool update_NeedUpgrade( update_t *p_update )
* \param l_size the size in bytes
* \return the size as a string
*/
static
char
*
size_str
(
long
in
t
l_size
)
static
char
*
size_str
(
uint64_
t
l_size
)
{
char
*
psz_tmp
=
NULL
;
int
i_retval
=
0
;
...
...
@@ -526,8 +526,8 @@ static void* update_DownloadReal( void *obj )
{
update_download_thread_t
*
p_udt
=
(
update_download_thread_t
*
)
obj
;
dialog_progress_bar_t
*
p_progress
=
NULL
;
long
in
t
l_size
;
long
in
t
l_downloaded
=
0
;
uint64_
t
l_size
;
uint64_
t
l_downloaded
=
0
;
float
f_progress
;
char
*
psz_status
;
char
*
psz_downloaded
=
NULL
;
...
...
@@ -556,7 +556,8 @@ static void* update_DownloadReal( void *obj )
}
/* Get the stream size */
l_size
=
stream_Size
(
p_stream
);
if
(
stream_GetSize
(
p_stream
,
&
l_size
)
||
l_size
==
0
)
goto
end
;
/* Get the file name and open it*/
psz_tmpdestfile
=
strrchr
(
p_update
->
release
.
psz_url
,
'/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment