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
3a9cb188
Commit
3a9cb188
authored
Dec 01, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/integer: Fix av_mod_i() with negative dividend
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
8e7f4520
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
integer.c
libavutil/integer.c
+8
-0
No files found.
libavutil/integer.c
View file @
3a9cb188
...
...
@@ -29,6 +29,8 @@
#include "integer.h"
#include "avassert.h"
static
const
AVInteger
zero_i
;
AVInteger
av_add_i
(
AVInteger
a
,
AVInteger
b
){
int
i
,
carry
=
0
;
...
...
@@ -111,6 +113,12 @@ AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b){
AVInteger
quot_temp
;
if
(
!
quot
)
quot
=
&
quot_temp
;
if
((
int16_t
)
a
.
v
[
AV_INTEGER_SIZE
-
1
]
<
0
)
{
a
=
av_mod_i
(
quot
,
av_sub_i
(
zero_i
,
a
),
b
);
*
quot
=
av_sub_i
(
zero_i
,
*
quot
);
return
av_sub_i
(
zero_i
,
a
);
}
av_assert2
((
int16_t
)
a
.
v
[
AV_INTEGER_SIZE
-
1
]
>=
0
&&
(
int16_t
)
b
.
v
[
AV_INTEGER_SIZE
-
1
]
>=
0
);
av_assert2
(
av_log2_i
(
b
)
>=
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