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
d4ac703c
Commit
d4ac703c
authored
May 04, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/formats: use sizeof(var) instead of sizeof(type).
parent
f10530b7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
formats.c
libavfilter/formats.c
+7
-7
No files found.
libavfilter/formats.c
View file @
d4ac703c
...
...
@@ -45,7 +45,7 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
AVFilterFormats
*
ret
;
unsigned
i
,
j
,
k
=
0
,
m_count
;
ret
=
av_mallocz
(
sizeof
(
AVFilterFormats
));
ret
=
av_mallocz
(
sizeof
(
*
ret
));
/* merge list of formats */
m_count
=
FFMIN
(
a
->
format_count
,
b
->
format_count
);
...
...
@@ -65,7 +65,7 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
return
NULL
;
}
ret
->
refs
=
av_malloc
(
sizeof
(
AVFilterFormats
**
)
*
(
a
->
refcount
+
b
->
refcount
));
ret
->
refs
=
av_malloc
(
sizeof
(
*
ret
->
refs
)
*
(
a
->
refcount
+
b
->
refcount
));
merge_ref
(
ret
,
a
);
merge_ref
(
ret
,
b
);
...
...
@@ -92,7 +92,7 @@ AVFilterFormats *avfilter_make_format_list(const int *fmts)
for
(
count
=
0
;
fmts
[
count
]
!=
-
1
;
count
++
)
;
formats
=
av_mallocz
(
sizeof
(
AVFilterF
ormats
));
formats
=
av_mallocz
(
sizeof
(
*
f
ormats
));
if
(
count
)
formats
->
formats
=
av_malloc
(
sizeof
(
*
formats
->
formats
)
*
count
);
formats
->
format_count
=
count
;
...
...
@@ -105,7 +105,7 @@ int avfilter_add_format(AVFilterFormats **avff, int fmt)
{
int
*
fmts
;
if
(
!
(
*
avff
)
&&
!
(
*
avff
=
av_mallocz
(
sizeof
(
AVFilterFormats
))))
if
(
!
(
*
avff
)
&&
!
(
*
avff
=
av_mallocz
(
sizeof
(
**
avff
))))
return
AVERROR
(
ENOMEM
);
fmts
=
av_realloc
((
*
avff
)
->
formats
,
...
...
@@ -136,7 +136,7 @@ AVFilterFormats *avfilter_all_formats(enum AVMediaType type)
void
avfilter_formats_ref
(
AVFilterFormats
*
f
,
AVFilterFormats
**
ref
)
{
*
ref
=
f
;
f
->
refs
=
av_realloc
(
f
->
refs
,
sizeof
(
AVFilterFormats
**
)
*
++
f
->
refcount
);
f
->
refs
=
av_realloc
(
f
->
refs
,
sizeof
(
*
f
->
refs
)
*
++
f
->
refcount
);
f
->
refs
[
f
->
refcount
-
1
]
=
ref
;
}
...
...
@@ -159,8 +159,8 @@ void avfilter_formats_unref(AVFilterFormats **ref)
idx
=
find_ref_index
(
ref
);
if
(
idx
>=
0
)
memmove
((
*
ref
)
->
refs
+
idx
,
(
*
ref
)
->
refs
+
idx
+
1
,
sizeof
(
AVFilterFormats
**
)
*
((
*
ref
)
->
refcount
-
idx
-
1
));
memmove
((
*
ref
)
->
refs
+
idx
,
(
*
ref
)
->
refs
+
idx
+
1
,
sizeof
(
*
(
*
ref
)
->
refs
)
*
((
*
ref
)
->
refcount
-
idx
-
1
));
if
(
!--
(
*
ref
)
->
refcount
)
{
av_free
((
*
ref
)
->
formats
);
...
...
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