Unified · Split
| @@ -1237,8 +1237,12 @@ static av_cold int png_dec_init(AVCodecContext *avctx) · 1236 unmodified lines | ||
| 1237 | 1237 | s->previous_picture.f = av_frame_alloc(); |
| 1238 | 1238 | s->last_picture.f = av_frame_alloc(); |
| 1239 | 1239 | s->picture.f = av_frame_alloc(); |
| 1240 | − if (!s->previous_picture.f || !s->last_picture.f || !s->picture.f) | |
| 1240 | + if (!s->previous_picture.f || !s->last_picture.f || !s->picture.f) { | |
| 1241 | + av_frame_free(&s->previous_picture.f); | |
| 1242 | + av_frame_free(&s->last_picture.f); | |
| 1243 | + av_frame_free(&s->picture.f); | |
| 1241 | 1244 | return AVERROR(ENOMEM); |
| 1245 | + } | |
| 1242 | 1246 | |
| 1243 | 1247 | if (!avctx->internal->is_copy) { |
| 1244 | 1248 | avctx->internal->allocate_progress = 1; |