Unified · Split
| @@ -70,6 +70,10 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) { · 69 unmodified lines | |||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | avctx->coded_frame= avcodec_alloc_frame(); | 72 | avctx->coded_frame= avcodec_alloc_frame(); |
| 73 | if (!avctx->coded_frame) { | ||
| 74 | gsm_destroy(avctx->priv_data); | ||
| 75 | return AVERROR(ENOMEM); | ||
| 76 | } | ||
| 73 | 77 | ||
| 74 | return 0; | 78 | return 0; |
| 75 | } | 79 | } |
| @@ -196,10 +196,13 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx) · 195 unmodified lines | |||
| 196 | 196 | ||
| 197 | avctx->frame_size = 160; | 197 | avctx->frame_size = 160; |
| 198 | avctx->coded_frame = avcodec_alloc_frame(); | 198 | avctx->coded_frame = avcodec_alloc_frame(); |
| 199 | if (!avctx->coded_frame) | ||
| 200 | return AVERROR(ENOMEM); | ||
| 199 | 201 | ||
| 200 | s->enc_state = Encoder_Interface_init(s->enc_dtx); | 202 | s->enc_state = Encoder_Interface_init(s->enc_dtx); |
| 201 | if (!s->enc_state) { | 203 | if (!s->enc_state) { |
| 202 | av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n"); | 204 | av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n"); |
| 205 | av_freep(&avctx->coded_frame); | ||
| 203 | return -1; | 206 | return -1; |
| 204 | } | 207 | } |
| 205 | 208 | ||
| @@ -39,6 +39,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 38 unmodified lines | |||
| 39 | int index; | 39 | int index; |
| 40 | 40 | ||
| 41 | avctx->coded_frame = avcodec_alloc_frame(); | 41 | avctx->coded_frame = avcodec_alloc_frame(); |
| 42 | if (!avctx->coded_frame) | ||
| 43 | return AVERROR(ENOMEM); | ||
| 42 | avctx->frame_size = 1024; | 44 | avctx->frame_size = 1024; |
| 43 | 45 | ||
| 44 | voGetAACEncAPI(&s->codec_api); | 46 | voGetAACEncAPI(&s->codec_api); |
| @@ -87,6 +87,8 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx) · 86 unmodified lines | |||
| 87 | 87 | ||
| 88 | avctx->frame_size = 320; | 88 | avctx->frame_size = 320; |
| 89 | avctx->coded_frame = avcodec_alloc_frame(); | 89 | avctx->coded_frame = avcodec_alloc_frame(); |
| 90 | if (!avctx->coded_frame) | ||
| 91 | return AVERROR(ENOMEM); | ||
| 90 | 92 | ||
| 91 | s->state = E_IF_init(); | 93 | s->state = E_IF_init(); |
| 92 | 94 | ||
| @@ -181,6 +181,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 180 unmodified lines | |||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | avctx->coded_frame= avcodec_alloc_frame(); | 183 | avctx->coded_frame= avcodec_alloc_frame(); |
| 184 | if (!avctx->coded_frame) | ||
| 185 | return AVERROR(ENOMEM); | ||
| 184 | 186 | ||
| 185 | return 0; | 187 | return 0; |
| 186 | } | 188 | } |
| @@ -49,6 +49,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx) · 48 unmodified lines | |||
| 49 | avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id); | 49 | avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id); |
| 50 | avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8; | 50 | avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8; |
| 51 | avctx->coded_frame= avcodec_alloc_frame(); | 51 | avctx->coded_frame= avcodec_alloc_frame(); |
| 52 | if (!avctx->coded_frame) | ||
| 53 | return AVERROR(ENOMEM); | ||
| 52 | 54 | ||
| 53 | return 0; | 55 | return 0; |
| 54 | } | 56 | } |
| @@ -59,6 +59,8 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) · 58 unmodified lines | |||
| 59 | context->lastSample[0] = context->lastSample[1] = 0; | 59 | context->lastSample[0] = context->lastSample[1] = 0; |
| 60 | 60 | ||
| 61 | avctx->coded_frame= avcodec_alloc_frame(); | 61 | avctx->coded_frame= avcodec_alloc_frame(); |
| 62 | if (!avctx->coded_frame) | ||
| 63 | return AVERROR(ENOMEM); | ||
| 62 | 64 | ||
| 63 | return 0; | 65 | return 0; |
| 64 | } | 66 | } |