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
104 c->video_size = avctx->width * avctx->height;104 c->video_size = avctx->width * avctx->height;
105 for (i = 0; i < 4; i++) {105 for (i = 0; i < 4; i++) {
106 c->frame[i] = av_mallocz(c->frame_size);106 c->frame[i] = av_mallocz(c->frame_size);
107 if (!c->frame[i]) {107 if (!c->frame[i])
108 paf_video_close(avctx);
109 return AVERROR(ENOMEM);108 return AVERROR(ENOMEM);
110 }
111 }109 }
112 110
113 return 0;111 return 0;
@@ -419,5 +417,5 @@ AVCodec ff_paf_video_decoder = { · 305 unmodified lines
419 .close = paf_video_close,417 .close = paf_video_close,
420 .decode = paf_video_decode,418 .decode = paf_video_decode,
421 .capabilities = AV_CODEC_CAP_DR1,419 .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,
423};421};

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