Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d94c577d
Commit
d94c577d
authored
Oct 30, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdutils: check fread() return value
parent
7d1b17b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
cmdutils.c
cmdutils.c
+15
-3
No files found.
cmdutils.c
View file @
d94c577d
...
...
@@ -787,6 +787,7 @@ int read_yesno(void)
int
read_file
(
const
char
*
filename
,
char
**
bufptr
,
size_t
*
size
)
{
int
ret
;
FILE
*
f
=
fopen
(
filename
,
"rb"
);
if
(
!
f
)
{
...
...
@@ -802,11 +803,22 @@ int read_file(const char *filename, char **bufptr, size_t *size)
fclose
(
f
);
return
AVERROR
(
ENOMEM
);
}
fread
(
*
bufptr
,
1
,
*
size
,
f
);
(
*
bufptr
)[
*
size
++
]
=
'\0'
;
ret
=
fread
(
*
bufptr
,
1
,
*
size
,
f
);
if
(
ret
<
*
size
)
{
av_free
(
*
bufptr
);
if
(
ferror
(
f
))
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Error while reading file '%s': %s
\n
"
,
filename
,
strerror
(
errno
));
ret
=
AVERROR
(
errno
);
}
else
ret
=
AVERROR_EOF
;
}
else
{
ret
=
0
;
(
*
bufptr
)[
*
size
++
]
=
'\0'
;
}
fclose
(
f
);
return
0
;
return
ret
;
}
void
init_pts_correction
(
PtsCorrectionContext
*
ctx
)
...
...
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