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
d6939960
Commit
d6939960
authored
Jan 03, 2008
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add crc check to ac3 decoder
Originally committed as revision 11379 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f7f8b4d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
ac3dec.c
libavcodec/ac3dec.c
+10
-3
No files found.
libavcodec/ac3dec.c
View file @
d6939960
...
...
@@ -35,6 +35,7 @@
#include "avcodec.h"
#include "ac3_parser.h"
#include "bitstream.h"
#include "crc.h"
#include "dsputil.h"
#include "random.h"
...
...
@@ -1101,15 +1102,21 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
return
-
1
;
}
avctx
->
sample_rate
=
s
->
sample_rate
;
avctx
->
bit_rate
=
s
->
bit_rate
;
/* check that reported frame size fits in input buffer */
if
(
s
->
frame_size
>
buf_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"incomplete frame
\n
"
);
return
-
1
;
}
/* check for crc mismatch */
if
(
av_crc
(
av_crc8005
,
0
,
&
buf
[
2
],
s
->
frame_size
-
2
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"frame CRC mismatch
\n
"
);
return
-
1
;
}
avctx
->
sample_rate
=
s
->
sample_rate
;
avctx
->
bit_rate
=
s
->
bit_rate
;
/* channel config */
s
->
out_channels
=
s
->
channels
;
if
(
avctx
->
request_channels
>
0
&&
avctx
->
request_channels
<=
2
&&
...
...
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