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
d76fff7d
Commit
d76fff7d
authored
Jun 21, 2013
by
Hendrik Leppkes
Committed by
Michael Niedermayer
Jun 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smvjpeg: use refcounted frames to avoid mem leaks
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1a405c68
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
smvjpegdec.c
libavcodec/smvjpegdec.c
+5
-2
No files found.
libavcodec/smvjpegdec.c
View file @
d76fff7d
...
...
@@ -111,6 +111,7 @@ static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
s
->
avctx
=
avcodec_alloc_context3
(
codec
);
av_dict_set
(
&
thread_opt
,
"threads"
,
"1"
,
0
);
s
->
avctx
->
refcounted_frames
=
1
;
s
->
avctx
->
flags
=
avctx
->
flags
;
s
->
avctx
->
idct_algo
=
avctx
->
idct_algo
;
if
(
ff_codec_open2_recursive
(
s
->
avctx
,
codec
,
&
thread_opt
)
<
0
)
{
...
...
@@ -133,9 +134,10 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
cur_frame
=
avpkt
->
pts
%
s
->
frames_per_jpeg
;
/* Are we at the start of a block? */
if
(
!
cur_frame
)
if
(
!
cur_frame
)
{
av_frame_unref
(
mjpeg_data
);
ret
=
avcodec_decode_video2
(
s
->
avctx
,
mjpeg_data
,
&
s
->
mjpeg_data_size
,
avpkt
);
else
if
(
!
s
->
mjpeg_data_size
)
}
else
if
(
!
s
->
mjpeg_data_size
)
return
AVERROR
(
EINVAL
);
desc
=
av_pix_fmt_desc_get
(
s
->
avctx
->
pix_fmt
);
...
...
@@ -177,6 +179,7 @@ static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
MJpegDecodeContext
*
jpg
=
&
s
->
jpg
;
jpg
->
picture_ptr
=
NULL
;
av_frame_free
(
&
s
->
picture
[
0
]);
av_frame_free
(
&
s
->
picture
[
1
]);
ff_codec_close_recursive
(
s
->
avctx
);
av_freep
(
&
s
->
avctx
);
...
...
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