You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/pngdec: fix mem leak in init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
08aec6f68e
commit
6e9b060e4f
@@ -1237,8 +1237,12 @@ static av_cold int png_dec_init(AVCodecContext *avctx)
|
|||||||
s->previous_picture.f = av_frame_alloc();
|
s->previous_picture.f = av_frame_alloc();
|
||||||
s->last_picture.f = av_frame_alloc();
|
s->last_picture.f = av_frame_alloc();
|
||||||
s->picture.f = av_frame_alloc();
|
s->picture.f = av_frame_alloc();
|
||||||
if (!s->previous_picture.f || !s->last_picture.f || !s->picture.f)
|
if (!s->previous_picture.f || !s->last_picture.f || !s->picture.f) {
|
||||||
|
av_frame_free(&s->previous_picture.f);
|
||||||
|
av_frame_free(&s->last_picture.f);
|
||||||
|
av_frame_free(&s->picture.f);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
if (!avctx->internal->is_copy) {
|
if (!avctx->internal->is_copy) {
|
||||||
avctx->internal->allocate_progress = 1;
|
avctx->internal->allocate_progress = 1;
|
||||||
|
Reference in New Issue
Block a user