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
45a1694f
Commit
45a1694f
authored
May 06, 2013
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jpeg2000dec: cleanup properly after decoding errors
Fixes memory leak in fate-redcode-demux.
parent
851465f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+7
-6
No files found.
libavcodec/jpeg2000dec.c
View file @
45a1694f
...
...
@@ -1285,26 +1285,27 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
return
-
1
;
}
if
(
ret
=
jpeg2000_read_main_headers
(
s
))
return
ret
;
goto
end
;
/* get picture buffer */
if
((
ret
=
ff_thread_get_buffer
(
avctx
,
&
frame
,
0
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ff_thread_get_buffer() failed.
\n
"
);
return
ret
;
goto
end
;
}
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
picture
->
key_frame
=
1
;
if
(
ret
=
jpeg2000_read_bitstream_packets
(
s
))
return
ret
;
goto
end
;
for
(
tileno
=
0
;
tileno
<
s
->
numXtiles
*
s
->
numYtiles
;
tileno
++
)
if
(
ret
=
jpeg2000_decode_tile
(
s
,
s
->
tile
+
tileno
,
picture
))
return
ret
;
jpeg2000_dec_cleanup
(
s
);
goto
end
;
*
got_frame
=
1
;
return
s
->
buf
-
s
->
buf_start
;
end:
jpeg2000_dec_cleanup
(
s
);
return
ret
?
ret
:
s
->
buf
-
s
->
buf_start
;
}
#define OFFSET(x) offsetof(Jpeg2000DecoderContext, x)
...
...
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