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
2f06b563
Commit
2f06b563
authored
Apr 21, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support broken v210 files with 64 byte padding.
Fixes ticket #743. Reviewed-by: Paul B Mahol
parent
6c0027bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
v210dec.c
libavcodec/v210dec.c
+12
-5
v210dec.h
libavcodec/v210dec.h
+1
-0
No files found.
libavcodec/v210dec.c
View file @
2f06b563
...
...
@@ -86,6 +86,18 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
stride
=
aligned_width
*
8
/
3
;
}
if
(
avpkt
->
size
<
stride
*
avctx
->
height
)
{
if
((((
avctx
->
width
+
23
)
/
24
)
*
24
*
8
)
/
3
*
avctx
->
height
==
avpkt
->
size
)
{
stride
=
avpkt
->
size
/
avctx
->
height
;
if
(
!
s
->
stride_warning_shown
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"Broken v210 with too small padding (64 byte) detected
\n
"
);
s
->
stride_warning_shown
=
1
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"packet too small
\n
"
);
return
-
1
;
}
}
aligned_input
=
!
((
uintptr_t
)
psrc
&
0xf
)
&&
!
(
stride
&
0xf
);
if
(
aligned_input
!=
s
->
aligned_input
)
{
s
->
aligned_input
=
aligned_input
;
...
...
@@ -96,11 +108,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if
(
pic
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
pic
);
if
(
avpkt
->
size
<
stride
*
avctx
->
height
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"packet too small
\n
"
);
return
-
1
;
}
pic
->
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
pic
)
<
0
)
return
-
1
;
...
...
libavcodec/v210dec.h
View file @
2f06b563
...
...
@@ -26,6 +26,7 @@ typedef struct {
AVClass
*
av_class
;
int
custom_stride
;
int
aligned_input
;
int
stride_warning_shown
;
void
(
*
unpack_frame
)(
const
uint32_t
*
src
,
uint16_t
*
y
,
uint16_t
*
u
,
uint16_t
*
v
,
int
width
);
}
V210DecContext
;
...
...
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