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
a8bdf240
Commit
a8bdf240
authored
Feb 16, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for coded_frame allocation failure in several audio encoders
parent
255ad888
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
0 deletions
+17
-0
libgsm.c
libavcodec/libgsm.c
+4
-0
libopencore-amr.c
libavcodec/libopencore-amr.c
+3
-0
libvo-aacenc.c
libavcodec/libvo-aacenc.c
+2
-0
libvo-amrwbenc.c
libavcodec/libvo-amrwbenc.c
+2
-0
mpegaudioenc.c
libavcodec/mpegaudioenc.c
+2
-0
pcm.c
libavcodec/pcm.c
+2
-0
roqaudioenc.c
libavcodec/roqaudioenc.c
+2
-0
No files found.
libavcodec/libgsm.c
View file @
a8bdf240
...
@@ -70,6 +70,10 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
...
@@ -70,6 +70,10 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
}
}
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
{
gsm_destroy
(
avctx
->
priv_data
);
return
AVERROR
(
ENOMEM
);
}
return
0
;
return
0
;
}
}
...
...
libavcodec/libopencore-amr.c
View file @
a8bdf240
...
@@ -196,10 +196,13 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
...
@@ -196,10 +196,13 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
avctx
->
frame_size
=
160
;
avctx
->
frame_size
=
160
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
s
->
enc_state
=
Encoder_Interface_init
(
s
->
enc_dtx
);
s
->
enc_state
=
Encoder_Interface_init
(
s
->
enc_dtx
);
if
(
!
s
->
enc_state
)
{
if
(
!
s
->
enc_state
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Encoder_Interface_init error
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Encoder_Interface_init error
\n
"
);
av_freep
(
&
avctx
->
coded_frame
);
return
-
1
;
return
-
1
;
}
}
...
...
libavcodec/libvo-aacenc.c
View file @
a8bdf240
...
@@ -39,6 +39,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
...
@@ -39,6 +39,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
int
index
;
int
index
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
avctx
->
frame_size
=
1024
;
avctx
->
frame_size
=
1024
;
voGetAACEncAPI
(
&
s
->
codec_api
);
voGetAACEncAPI
(
&
s
->
codec_api
);
...
...
libavcodec/libvo-amrwbenc.c
View file @
a8bdf240
...
@@ -87,6 +87,8 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx)
...
@@ -87,6 +87,8 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx)
avctx
->
frame_size
=
320
;
avctx
->
frame_size
=
320
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
s
->
state
=
E_IF_init
();
s
->
state
=
E_IF_init
();
...
...
libavcodec/mpegaudioenc.c
View file @
a8bdf240
...
@@ -181,6 +181,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
...
@@ -181,6 +181,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
}
}
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
return
0
;
return
0
;
}
}
...
...
libavcodec/pcm.c
View file @
a8bdf240
...
@@ -49,6 +49,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
...
@@ -49,6 +49,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
avctx
->
bits_per_coded_sample
=
av_get_bits_per_sample
(
avctx
->
codec
->
id
);
avctx
->
bits_per_coded_sample
=
av_get_bits_per_sample
(
avctx
->
codec
->
id
);
avctx
->
block_align
=
avctx
->
channels
*
avctx
->
bits_per_coded_sample
/
8
;
avctx
->
block_align
=
avctx
->
channels
*
avctx
->
bits_per_coded_sample
/
8
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
return
0
;
return
0
;
}
}
...
...
libavcodec/roqaudioenc.c
View file @
a8bdf240
...
@@ -59,6 +59,8 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
...
@@ -59,6 +59,8 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
context
->
lastSample
[
0
]
=
context
->
lastSample
[
1
]
=
0
;
context
->
lastSample
[
0
]
=
context
->
lastSample
[
1
]
=
0
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
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