Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-29 10:05:17 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-30 04:00:42 +0300
commit7c8cf40adcee516caaa16e7da364c87b204d31a6 (patch)
treee9422051aab019d720cf5cf5be10df62e4d6342b /libavcodec/roqvideoenc.c
parentc38405c149df2aee1a3d25942453ca02af5a44b9 (diff)
avcodec/roqvideoenc: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/roqvideoenc.c')
-rw-r--r--libavcodec/roqvideoenc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index ac05123dc6..dc6a63099d 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1004,10 +1004,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->last_frame = av_frame_alloc();
enc->current_frame = av_frame_alloc();
- if (!enc->last_frame || !enc->current_frame) {
- roq_encode_end(avctx);
+ if (!enc->last_frame || !enc->current_frame)
return AVERROR(ENOMEM);
- }
enc->tmpData = av_malloc(sizeof(RoqTempdata));
@@ -1024,10 +1022,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
av_malloc_array ((enc->width*enc->height/64), sizeof(motion_vect));
if (!enc->tmpData || !enc->this_motion4 || !enc->last_motion4 ||
- !enc->this_motion8 || !enc->last_motion8) {
- roq_encode_end(avctx);
+ !enc->this_motion8 || !enc->last_motion8)
return AVERROR(ENOMEM);
- }
return 0;
}
@@ -1135,4 +1131,5 @@ AVCodec ff_roq_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NONE },
.priv_class = &roq_class,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};