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
fc5c49ab
Commit
fc5c49ab
authored
Dec 24, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videodec: Fix division by zero in mpeg4_decode_sprite_trajectory()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
43abef9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+9
-3
No files found.
libavcodec/mpeg4videodec.c
View file @
fc5c49ab
...
...
@@ -160,7 +160,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
return
0
;
}
static
void
mpeg4_decode_sprite_trajectory
(
MpegEncContext
*
s
,
GetBitContext
*
gb
)
static
int
mpeg4_decode_sprite_trajectory
(
MpegEncContext
*
s
,
GetBitContext
*
gb
)
{
int
i
;
int
a
=
2
<<
s
->
sprite_warping_accuracy
;
...
...
@@ -176,6 +176,9 @@ static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb
int
h
=
s
->
height
;
int
min_ab
;
if
(
w
<=
0
||
h
<=
0
)
return
-
1
;
for
(
i
=
0
;
i
<
s
->
num_sprite_warping_points
;
i
++
){
int
length
;
int
x
=
0
,
y
=
0
;
...
...
@@ -348,6 +351,7 @@ static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb
}
s
->
real_sprite_warping_points
=
s
->
num_sprite_warping_points
;
}
return
0
;
}
/**
...
...
@@ -411,7 +415,8 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
skip_bits
(
&
s
->
gb
,
3
);
/* intra dc vlc threshold */
//FIXME don't just ignore everything
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_S
&&
s
->
vol_sprite_usage
==
GMC_SPRITE
){
mpeg4_decode_sprite_trajectory
(
s
,
&
s
->
gb
);
if
(
mpeg4_decode_sprite_trajectory
(
s
,
&
s
->
gb
)
<
0
)
return
-
1
;
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"untested
\n
"
);
}
...
...
@@ -2051,7 +2056,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
}
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_S
&&
(
s
->
vol_sprite_usage
==
STATIC_SPRITE
||
s
->
vol_sprite_usage
==
GMC_SPRITE
)){
mpeg4_decode_sprite_trajectory
(
s
,
gb
);
if
(
mpeg4_decode_sprite_trajectory
(
s
,
gb
)
<
0
)
return
-
1
;
if
(
s
->
sprite_brightness_change
)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"sprite_brightness_change not supported
\n
"
);
if
(
s
->
vol_sprite_usage
==
STATIC_SPRITE
)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"static sprite not supported
\n
"
);
}
...
...
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