Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
libdvdread
Commits
a3d56905
Commit
a3d56905
authored
Jan 15, 2015
by
Steve Dibb
Committed by
Jean-Baptiste Kempf
Jan 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for malloc fail before setting secbuf
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
e381f076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/dvd_reader.c
src/dvd_reader.c
+1
-1
No files found.
src/dvd_reader.c
View file @
a3d56905
...
...
@@ -1323,12 +1323,12 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
(
(
(
seek_byte
+
byte_size
)
%
DVD_VIDEO_LB_LEN
)
?
1
:
0
);
secbuf_base
=
malloc
(
numsec
*
DVD_VIDEO_LB_LEN
+
2048
);
secbuf
=
(
unsigned
char
*
)(((
uintptr_t
)
secbuf_base
&
~
((
uintptr_t
)
2047
))
+
2048
);
if
(
!
secbuf_base
)
{
fprintf
(
stderr
,
"libdvdread: Can't allocate memory "
"for file read!
\n
"
);
return
0
;
}
secbuf
=
(
unsigned
char
*
)(((
uintptr_t
)
secbuf_base
&
~
((
uintptr_t
)
2047
))
+
2048
);
if
(
dvd_file
->
dvd
->
isImageFile
)
{
ret
=
DVDReadBlocksUDF
(
dvd_file
,
(
uint32_t
)
seek_sector
,
...
...
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