History

avcodec/pafvideo: Cleanup generically on init failure

Andreas Rheinhardt committed 5 years ago

Commit 7eb9cf51 parent 92277211 file · +2 −4Browse files

Unified · Split

libavcodec/pafvideo.c+2−4
@@ -104,10 +104,8 @@ static av_cold int paf_video_init(AVCodecContext *avctx) · 103 unmodified lines
104104 c->video_size = avctx->width * avctx->height;
105105 for (i = 0; i < 4; i++) {
106106 c->frame[i] = av_mallocz(c->frame_size);
107− if (!c->frame[i]) {
108− paf_video_close(avctx);
107+ if (!c->frame[i])
109108 return AVERROR(ENOMEM);
110− }
111109 }
112110
113111 return 0;
@@ -419,5 +417,5 @@ AVCodec ff_paf_video_decoder = { · 305 unmodified lines
419417 .close = paf_video_close,
420418 .decode = paf_video_decode,
421419 .capabilities = AV_CODEC_CAP_DR1,
422− .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
420+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
423421 };

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