History

avcodec/pngdec: fix mem leak in init()

Benoit Fouet committed 11 years ago

Commit 6e9b0601 parent 08aec6f1 file · +5 −1Browse files

Unified · Split

libavcodec/pngdec.c+5−1
@@ -1237,8 +1237,12 @@ static av_cold int png_dec_init(AVCodecContext *avctx) · 1236 unmodified lines
1237 s->previous_picture.f = av_frame_alloc();1237 s->previous_picture.f = av_frame_alloc();
1238 s->last_picture.f = av_frame_alloc();1238 s->last_picture.f = av_frame_alloc();
1239 s->picture.f = av_frame_alloc();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 return AVERROR(ENOMEM);1244 return AVERROR(ENOMEM);
1245 }
1242 1246
1243 if (!avctx->internal->is_copy) {1247 if (!avctx->internal->is_copy) {
1244 avctx->internal->allocate_progress = 1;1248 avctx->internal->allocate_progress = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t