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
d7a4c43f
Commit
d7a4c43f
authored
Apr 20, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffv1: Add a CRC check to the global header with version 1.3
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
97502548
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
ffv1.c
libavcodec/ffv1.c
+14
-1
No files found.
libavcodec/ffv1.c
View file @
d7a4c43f
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "mathops.h"
#include "mathops.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#ifdef __INTEL_COMPILER
#ifdef __INTEL_COMPILER
#undef av_flatten
#undef av_flatten
...
@@ -775,6 +776,7 @@ static int write_extra_header(FFV1Context *f){
...
@@ -775,6 +776,7 @@ static int write_extra_header(FFV1Context *f){
uint8_t
state
[
CONTEXT_SIZE
];
uint8_t
state
[
CONTEXT_SIZE
];
int
i
,
j
,
k
;
int
i
,
j
,
k
;
uint8_t
state2
[
32
][
CONTEXT_SIZE
];
uint8_t
state2
[
32
][
CONTEXT_SIZE
];
unsigned
v
;
memset
(
state2
,
128
,
sizeof
(
state2
));
memset
(
state2
,
128
,
sizeof
(
state2
));
memset
(
state
,
128
,
sizeof
(
state
));
memset
(
state
,
128
,
sizeof
(
state
));
...
@@ -823,6 +825,9 @@ static int write_extra_header(FFV1Context *f){
...
@@ -823,6 +825,9 @@ static int write_extra_header(FFV1Context *f){
}
}
f
->
avctx
->
extradata_size
=
ff_rac_terminate
(
c
);
f
->
avctx
->
extradata_size
=
ff_rac_terminate
(
c
);
v
=
av_crc
(
av_crc_get_table
(
AV_CRC_32_IEEE
),
0
,
f
->
avctx
->
extradata
,
f
->
avctx
->
extradata_size
);
AV_WL32
(
f
->
avctx
->
extradata
+
f
->
avctx
->
extradata_size
,
v
);
f
->
avctx
->
extradata_size
+=
4
;
return
0
;
return
0
;
}
}
...
@@ -1613,6 +1618,15 @@ static int read_extra_header(FFV1Context *f){
...
@@ -1613,6 +1618,15 @@ static int read_extra_header(FFV1Context *f){
}
}
}
}
if
(
f
->
version
>
2
){
unsigned
v
;
v
=
av_crc
(
av_crc_get_table
(
AV_CRC_32_IEEE
),
0
,
f
->
avctx
->
extradata
,
f
->
avctx
->
extradata_size
);
if
(
v
){
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"CRC mismatch %X!
\n
"
,
v
);
return
AVERROR_INVALIDDATA
;
}
}
return
0
;
return
0
;
}
}
...
@@ -1767,7 +1781,6 @@ static int read_header(FFV1Context *f){
...
@@ -1767,7 +1781,6 @@ static int read_header(FFV1Context *f){
p
->
context_count
=
context_count
;
p
->
context_count
=
context_count
;
}
}
}
}
return
0
;
return
0
;
}
}
...
...
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