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
1c6d2bb9
Commit
1c6d2bb9
authored
Aug 06, 2013
by
Christian Schmidt
Committed by
Diego Biurrun
Aug 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_bluray: Return AVERROR_INVALIDDATA instead of -1 on header errors
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
6fb65973
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
pcm-mpeg.c
libavcodec/pcm-mpeg.c
+7
-7
No files found.
libavcodec/pcm-mpeg.c
View file @
1c6d2bb9
/*
* LPCM codecs for PCM formats found in MPEG streams
* Copyright (c) 2009 Christian Schmidt
* Copyright (c) 2009
, 2013
Christian Schmidt
*
* This file is part of Libav.
*
...
...
@@ -72,7 +72,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
avctx
->
bits_per_coded_sample
=
bits_per_samples
[
header
[
3
]
>>
6
];
if
(
!
avctx
->
bits_per_coded_sample
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"reserved sample depth (0)
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
avctx
->
sample_fmt
=
avctx
->
bits_per_coded_sample
==
16
?
AV_SAMPLE_FMT_S16
:
AV_SAMPLE_FMT_S32
;
...
...
@@ -93,7 +93,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
avctx
->
sample_rate
=
0
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"reserved sample rate (%d)
\n
"
,
header
[
2
]
&
0x0f
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
/*
...
...
@@ -107,7 +107,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
if
(
!
avctx
->
channels
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"reserved channel configuration (%d)
\n
"
,
channel_layout
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
avctx
->
bit_rate
=
FFALIGN
(
avctx
->
channels
,
2
)
*
avctx
->
sample_rate
*
...
...
@@ -135,11 +135,11 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
if
(
buf_size
<
4
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"PCM packet too small
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
pcm_bluray_parse_header
(
avctx
,
src
))
return
-
1
;
if
(
(
retval
=
pcm_bluray_parse_header
(
avctx
,
src
)
))
return
retval
;
src
+=
4
;
buf_size
-=
4
;
...
...
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