Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
9bca33b9
Commit
9bca33b9
authored
Feb 07, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmafixed: handle error cases (fixes #2474)
parent
ca6444e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
modules/codec/wmafixed/wma.c
modules/codec/wmafixed/wma.c
+27
-5
No files found.
modules/codec/wmafixed/wma.c
View file @
9bca33b9
...
...
@@ -198,13 +198,23 @@ static aout_buffer_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
block_t
*
p_block
;
mtime_t
start
=
mdate
();
/* for statistics */
aout_buffer_t
*
p_aout_buffer
=
NULL
;
#ifdef NDEBUG
mtime_t
start
=
mdate
();
/* for statistics */
#endif
if
(
!
pp_block
||
!*
pp_block
)
return
NULL
;
p_block
=
*
pp_block
;
if
(
p_block
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
)
)
{
aout_DateSet
(
&
p_sys
->
end_date
,
0
);
block_Release
(
p_block
);
*
pp_block
=
NULL
;
return
NULL
;
}
if
(
p_block
->
i_buffer
<=
0
)
{
/* we already decoded the samples, just feed a few to aout */
...
...
@@ -235,8 +245,14 @@ static aout_buffer_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
}
wma_decode_superframe_init
(
&
p_sys
->
wmadec
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
if
(
wma_decode_superframe_init
(
&
p_sys
->
wmadec
,
p_block
->
p_buffer
,
p_block
->
i_buffer
)
==
0
)
{
msg_Err
(
p_dec
,
"failed initializing wmafixed decoder"
);
block_Release
(
p_block
);
*
pp_block
=
NULL
;
return
NULL
;
}
if
(
p_sys
->
wmadec
.
nb_frames
<=
0
)
{
...
...
@@ -248,6 +264,8 @@ static aout_buffer_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
/* worst case */
size_t
i_buffer
=
BLOCK_MAX_SIZE
*
MAX_CHANNELS
*
p_sys
->
wmadec
.
nb_frames
;
if
(
p_sys
->
p_output
)
free
(
p_sys
->
p_output
);
p_sys
->
p_output
=
malloc
(
i_buffer
*
sizeof
(
int32_t
)
);
p_sys
->
p_samples
=
(
int8_t
*
)
p_sys
->
p_output
;
...
...
@@ -269,10 +287,14 @@ static aout_buffer_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
p_block
->
p_buffer
,
p_block
->
i_buffer
);
if
(
i_samples
<
0
)
{
msg_Warn
(
p_dec
,
"wma_decode_superframe_frame() failed for frame %d"
,
i
);
else
p_sys
->
i_samples
+=
i_samples
;
/* advance in the samples buffer */
free
(
p_sys
->
p_output
);
p_sys
->
p_output
=
NULL
;
return
NULL
;
}
p_sys
->
i_samples
+=
i_samples
;
/* advance in the samples buffer */
}
p_block
->
i_buffer
=
0
;
/* this block has been decoded */
...
...
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