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
efe34e87
Commit
efe34e87
authored
Nov 24, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/libxvid: fix mem leak in case of init failure
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
5182a2a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
libxvid.c
libavcodec/libxvid.c
+7
-4
No files found.
libavcodec/libxvid.c
View file @
efe34e87
...
@@ -359,7 +359,7 @@ static void xvid_correct_framerate(AVCodecContext *avctx)
...
@@ -359,7 +359,7 @@ static void xvid_correct_framerate(AVCodecContext *avctx)
static
av_cold
int
xvid_encode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
xvid_encode_init
(
AVCodecContext
*
avctx
)
{
{
int
xerr
,
i
;
int
xerr
,
i
,
ret
=
-
1
;
int
xvid_flags
=
avctx
->
flags
;
int
xvid_flags
=
avctx
->
flags
;
struct
xvid_context
*
x
=
avctx
->
priv_data
;
struct
xvid_context
*
x
=
avctx
->
priv_data
;
uint16_t
*
intra
,
*
inter
;
uint16_t
*
intra
,
*
inter
;
...
@@ -659,13 +659,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -659,13 +659,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
avctx
->
coded_frame
=
av_frame_alloc
();
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
avctx
->
coded_frame
)
if
(
!
avctx
->
coded_frame
)
{
return
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
return
0
;
return
0
;
fail:
fail:
xvid_encode_close
(
avctx
);
xvid_encode_close
(
avctx
);
return
-
1
;
return
ret
;
}
}
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
...
@@ -812,6 +814,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx)
...
@@ -812,6 +814,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx)
av_freep
(
&
x
->
twopassfile
);
av_freep
(
&
x
->
twopassfile
);
av_freep
(
&
x
->
intra_matrix
);
av_freep
(
&
x
->
intra_matrix
);
av_freep
(
&
x
->
inter_matrix
);
av_freep
(
&
x
->
inter_matrix
);
av_frame_free
(
&
avctx
->
coded_frame
);
return
0
;
return
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