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
b077eb07
Commit
b077eb07
authored
Nov 11, 2012
by
Alberto Delmás
Committed by
Kostya Shishkov
Nov 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mss2: fix handling of unmasked implicit WMV9 rectangles
Signed-off-by:
Kostya Shishkov
<
kostya.shishkov@gmail.com
>
parent
e5e1a06e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
mss2.c
libavcodec/mss2.c
+13
-10
No files found.
libavcodec/mss2.c
View file @
b077eb07
...
@@ -474,7 +474,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -474,7 +474,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int
keyframe
,
has_wmv9
,
has_mv
,
is_rle
,
is_555
,
ret
;
int
keyframe
,
has_wmv9
,
has_mv
,
is_rle
,
is_555
,
ret
;
Rectangle
wmv9rects
[
MAX_WMV9_RECTANGLES
],
*
r
;
Rectangle
wmv9rects
[
MAX_WMV9_RECTANGLES
],
*
r
;
int
used_rects
=
0
,
i
,
implicit_rect
,
av_uninit
(
wmv9_mask
);
int
used_rects
=
0
,
i
,
implicit_rect
=
0
,
av_uninit
(
wmv9_mask
);
av_assert0
(
FF_INPUT_BUFFER_PADDING_SIZE
>=
av_assert0
(
FF_INPUT_BUFFER_PADDING_SIZE
>=
ARITH2_PADDING
+
(
MIN_CACHE_BITS
+
7
)
/
8
);
ARITH2_PADDING
+
(
MIN_CACHE_BITS
+
7
)
/
8
);
...
@@ -650,7 +650,14 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -650,7 +650,14 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
buf_size
-=
bytestream2_tell
(
&
gB
);
buf_size
-=
bytestream2_tell
(
&
gB
);
}
else
if
(
is_rle
)
{
}
else
{
if
(
keyframe
)
{
c
->
corrupted
=
0
;
ff_mss12_slicecontext_reset
(
&
ctx
->
sc
[
0
]);
if
(
c
->
slice_split
)
ff_mss12_slicecontext_reset
(
&
ctx
->
sc
[
1
]);
}
if
(
is_rle
)
{
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
if
(
ret
=
decode_rle
(
&
gb
,
c
->
pal_pic
,
c
->
pal_stride
,
if
(
ret
=
decode_rle
(
&
gb
,
c
->
pal_pic
,
c
->
pal_stride
,
c
->
rgb_pic
,
c
->
rgb_stride
,
c
->
pal
,
keyframe
,
c
->
rgb_pic
,
c
->
rgb_stride
,
c
->
pal
,
keyframe
,
...
@@ -669,14 +676,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -669,14 +676,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
align_get_bits
(
&
gb
);
align_get_bits
(
&
gb
);
buf
+=
get_bits_count
(
&
gb
)
>>
3
;
buf
+=
get_bits_count
(
&
gb
)
>>
3
;
buf_size
-=
get_bits_count
(
&
gb
)
>>
3
;
buf_size
-=
get_bits_count
(
&
gb
)
>>
3
;
}
else
{
}
else
if
(
!
implicit_rect
||
wmv9_mask
!=
-
1
)
{
if
(
keyframe
)
{
if
(
c
->
corrupted
)
c
->
corrupted
=
0
;
ff_mss12_slicecontext_reset
(
&
ctx
->
sc
[
0
]);
if
(
c
->
slice_split
)
ff_mss12_slicecontext_reset
(
&
ctx
->
sc
[
1
]);
}
else
if
(
c
->
corrupted
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
bytestream2_init
(
&
gB
,
buf
,
buf_size
+
ARITH2_PADDING
);
bytestream2_init
(
&
gB
,
buf
,
buf_size
+
ARITH2_PADDING
);
arith2_init
(
&
acoder
,
&
gB
);
arith2_init
(
&
acoder
,
&
gB
);
...
@@ -702,6 +703,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -702,6 +703,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
buf
+=
arith2_get_consumed_bytes
(
&
acoder
);
buf
+=
arith2_get_consumed_bytes
(
&
acoder
);
buf_size
-=
arith2_get_consumed_bytes
(
&
acoder
);
buf_size
-=
arith2_get_consumed_bytes
(
&
acoder
);
}
}
}
else
memset
(
c
->
pal_pic
,
0
,
c
->
pal_stride
*
avctx
->
height
);
}
}
if
(
has_wmv9
)
{
if
(
has_wmv9
)
{
...
...
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