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
80da2dcf
Commit
80da2dcf
authored
Apr 24, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use av_fast_malloc instead of av_realloc in fraps decoder.
parent
88dbbe97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
fraps.c
libavcodec/fraps.c
+3
-2
No files found.
libavcodec/fraps.c
View file @
80da2dcf
...
...
@@ -46,6 +46,7 @@ typedef struct FrapsContext{
AVCodecContext
*
avctx
;
AVFrame
frame
;
uint8_t
*
tmpbuf
;
int
tmpbuf_size
;
DSPContext
dsp
;
}
FrapsContext
;
...
...
@@ -272,7 +273,7 @@ static int decode_frame(AVCodecContext *avctx,
offs
[
planes
]
=
buf_size
;
for
(
i
=
0
;
i
<
planes
;
i
++
){
is_chroma
=
!!
i
;
s
->
tmpbuf
=
av_realloc
(
s
->
tmpbuf
,
offs
[
i
+
1
]
-
offs
[
i
]
-
1024
+
FF_INPUT_BUFFER_PADDING_SIZE
);
av_fast_malloc
(
&
s
->
tmpbuf
,
&
s
->
tmpbuf_size
,
offs
[
i
+
1
]
-
offs
[
i
]
-
1024
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
fraps2_decode_plane
(
s
,
f
->
data
[
i
],
f
->
linesize
[
i
],
avctx
->
width
>>
is_chroma
,
avctx
->
height
>>
is_chroma
,
buf
+
offs
[
i
],
offs
[
i
+
1
]
-
offs
[
i
],
is_chroma
,
1
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error decoding plane %i
\n
"
,
i
);
...
...
@@ -314,7 +315,7 @@ static int decode_frame(AVCodecContext *avctx,
}
offs
[
planes
]
=
buf_size
;
for
(
i
=
0
;
i
<
planes
;
i
++
){
s
->
tmpbuf
=
av_realloc
(
s
->
tmpbuf
,
offs
[
i
+
1
]
-
offs
[
i
]
-
1024
+
FF_INPUT_BUFFER_PADDING_SIZE
);
av_fast_malloc
(
&
s
->
tmpbuf
,
&
s
->
tmpbuf_size
,
offs
[
i
+
1
]
-
offs
[
i
]
-
1024
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
fraps2_decode_plane
(
s
,
f
->
data
[
0
]
+
i
+
(
f
->
linesize
[
0
]
*
(
avctx
->
height
-
1
)),
-
f
->
linesize
[
0
],
avctx
->
width
,
avctx
->
height
,
buf
+
offs
[
i
],
offs
[
i
+
1
]
-
offs
[
i
],
0
,
3
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error decoding plane %i
\n
"
,
i
);
...
...
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