Signed-off-by: Paul B Mahol <[email protected]>
---
libavcodec/ac3enc.c | 2 ++
libavcodec/adpcmenc.c | 3 +++
libavcodec/adxenc.c | 2 ++
libavcodec/alacenc.c | 3 +++
libavcodec/libfaac.c | 3 +++
libavcodec/libgsm.c | 3 +++
libavcodec/libmp3lame.c | 3 +++
libavcodec/libopencore-amr.c | 2 ++
libavcodec/libtheoraenc.c | 2 ++
libavcodec/libvo-aacenc.c | 3 +++
libavcodec/libvo-amrwbenc.c | 2 ++
libavcodec/libvorbis.c | 3 +++
libavcodec/mpegaudioenc.c | 3 +++
libavcodec/pcm.c | 3 +++
libavcodec/r210dec.c | 2 ++
libavcodec/roqaudioenc.c | 3 +++
libavcodec/v210dec.c | 2 ++
libavcodec/v210enc.c | 2 ++
libavcodec/v210x.c | 2 ++
libavcodec/vorbisenc.c | 3 +++
20 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index b8e23e4..2c3571d 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -2469,6 +2469,8 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
goto init_fail;
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
dsputil_init(&s->dsp, avctx);
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 9697f82..c0b0e5b 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -136,6 +136,9 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
}
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
return 0;
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index 20f2798..c482e52 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -120,6 +120,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
avctx->frame_size = BLOCK_SAMPLES;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
/* the cutoff can be adjusted, but this seems to work pretty well */
c->cutoff = 500;
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index 89d8e09..d4bb8ef 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -476,6 +476,9 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
avctx->extradata_size = ALAC_EXTRADATA_SIZE;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame = 1;
s->avctx = avctx;
diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index 7ee1f3c..2d793a1 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
@@ -90,6 +90,9 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx)
avctx->frame_size = samples_input / avctx->channels;
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
/* Set decoder specific info */
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index 1fa04cf..98d7e9f 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -70,6 +70,9 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
}
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
return 0;
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index f3c4528..43da9f4 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -77,6 +77,9 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
avctx->frame_size = lame_get_framesize(s->gfp);
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame = 1;
return 0;
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index ded9217..f5e6bcf 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -196,6 +196,8 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
avctx->frame_size = 160;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
s->enc_state = Encoder_Interface_init(s->enc_dtx);
if (!s->enc_state) {
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index eccecea..a5efa10 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -256,6 +256,8 @@ static av_cold int encode_init(AVCodecContext* avc_context)
/* Set up the output AVFrame */
avc_context->coded_frame= avcodec_alloc_frame();
+ if (!avc_context->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}
diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c
index 647971a..f67414f 100644
--- a/libavcodec/libvo-aacenc.c
+++ b/libavcodec/libvo-aacenc.c
@@ -39,6 +39,9 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
int index;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->frame_size = 1024;
voGetAACEncAPI(&s->codec_api);
diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c
index f39317e..78b21f8 100644
--- a/libavcodec/libvo-amrwbenc.c
+++ b/libavcodec/libvo-amrwbenc.c
@@ -87,6 +87,8 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx)
avctx->frame_size = 320;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
s->state = E_IF_init();
diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c
index 25e6006..da7e2f9 100644
--- a/libavcodec/libvorbis.c
+++ b/libavcodec/libvorbis.c
@@ -156,6 +156,9 @@ static av_cold int oggvorbis_encode_init(AVCodecContext
*avccontext)
avccontext->frame_size = OGGVORBIS_FRAME_SIZE;
avccontext->coded_frame = avcodec_alloc_frame();
+ if (!avccontext->coded_frame)
+ return AVERROR(ENOMEM);
+
avccontext->coded_frame->key_frame = 1;
return 0;
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index 71ea393..d6eef87 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -181,6 +181,9 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
}
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
return 0;
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 1adaf70..24af374 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -49,6 +49,9 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
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->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
return 0;
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
index 0f85f58..101122c 100644
--- a/libavcodec/r210dec.c
+++ b/libavcodec/r210dec.c
@@ -29,6 +29,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->bits_per_raw_sample = 10;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}
diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c
index e540e14..c396763 100644
--- a/libavcodec/roqaudioenc.c
+++ b/libavcodec/roqaudioenc.c
@@ -59,6 +59,9 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
context->lastSample[0] = context->lastSample[1] = 0;
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
avctx->coded_frame->key_frame= 1;
return 0;
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 37b4a3c..d464572 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -34,6 +34,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->bits_per_raw_sample = 10;
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 5861352..069f915 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -41,6 +41,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->bits_per_raw_sample);
avctx->coded_frame = avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c
index 959dec5..eb98866 100644
--- a/libavcodec/v210x.c
+++ b/libavcodec/v210x.c
@@ -31,6 +31,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->bits_per_raw_sample= 10;
avctx->coded_frame= avcodec_alloc_frame();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index 00fe402..4f76731 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -974,6 +974,9 @@ static av_cold int vorbis_encode_init(AVCodecContext
*avccontext)
avccontext->frame_size = 1 << (venc->log2_blocksize[0] - 1);
avccontext->coded_frame = avcodec_alloc_frame();
+ if (!avccontext->coded_frame)
+ return AVERROR(ENOMEM);
+
avccontext->coded_frame->key_frame = 1;
return 0;
--
1.7.7
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel