Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
4d7a0a05
Commit
4d7a0a05
authored
22 years ago
by
Fabrice Bellard
Browse files
Options
Downloads
Patches
Plain Diff
better av_freep()
Originally committed as revision 541 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
51a49663
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/common.h
+2
-9
2 additions, 9 deletions
libavcodec/common.h
libavcodec/utils.c
+7
-0
7 additions, 0 deletions
libavcodec/utils.c
with
9 additions
and
9 deletions
libavcodec/common.h
+
2
−
9
View file @
4d7a0a05
...
@@ -57,14 +57,6 @@ typedef INT32 int32_t;
...
@@ -57,14 +57,6 @@ typedef INT32 int32_t;
#define inline __inline
#define inline __inline
/*
Disable warning messages:
warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
warning C4305: 'argument' : truncation from 'const double' to 'float'
*/
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
#else
#else
#define INT64_C(c) (c ## LL)
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#define UINT64_C(c) (c ## ULL)
...
@@ -901,7 +893,8 @@ static inline int clip(int a, int amin, int amax)
...
@@ -901,7 +893,8 @@ static inline int clip(int a, int amin, int amax)
void
*
av_malloc
(
int
size
);
void
*
av_malloc
(
int
size
);
void
*
av_mallocz
(
int
size
);
void
*
av_mallocz
(
int
size
);
void
av_free
(
void
*
ptr
);
void
av_free
(
void
*
ptr
);
#define av_freep(p) do { av_free(*p); *p = NULL; } while (0)
void
__av_freep
(
void
**
ptr
);
#define av_freep(p) __av_freep((void **)(p))
/* math */
/* math */
int
ff_gcd
(
int
a
,
int
b
);
int
ff_gcd
(
int
a
,
int
b
);
...
...
This diff is collapsed.
Click to expand it.
libavcodec/utils.c
+
7
−
0
View file @
4d7a0a05
...
@@ -65,6 +65,13 @@ void av_free(void *ptr)
...
@@ -65,6 +65,13 @@ void av_free(void *ptr)
free
(
ptr
);
free
(
ptr
);
}
}
/* cannot call it directly because of 'void **' casting is not automatic */
void
__av_freep
(
void
**
ptr
)
{
av_free
(
*
ptr
);
*
ptr
=
NULL
;
}
/* encoder management */
/* encoder management */
AVCodec
*
first_avcodec
;
AVCodec
*
first_avcodec
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment