int i;
AVFilterBufferRef *picref = NULL;
AVFilterPool *pool = link->pool;
+ int full_perms = AV_PERM_READ | AV_PERM_WRITE | AV_PERM_PRESERVE |
+ AV_PERM_REUSE | AV_PERM_REUSE2 | AV_PERM_ALIGN;
+
+ av_assert1(!(perms & ~(full_perms | AV_PERM_NEG_LINESIZES)));
if (pool) {
for (i = 0; i < POOL_SIZE; i++) {
pool->count--;
picref->video->w = w;
picref->video->h = h;
- picref->perms = perms | AV_PERM_READ;
+ picref->perms = full_perms;
picref->format = link->format;
pic->refcount = 1;
memcpy(picref->data, pic->data, sizeof(picref->data));
return NULL;
picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,
- perms, w, h, link->format);
+ full_perms, w, h, link->format);
if (!picref) {
av_free(data[0]);
return NULL;
AVFilterBufferRef *outpicref = NULL, *for_next_filter;
int ret = 0;
- if ((inpicref->perms & AV_PERM_WRITE) && !(inpicref->perms & AV_PERM_PRESERVE)) {
+ if (inpicref->perms & AV_PERM_WRITE) {
outpicref = avfilter_ref_buffer(inpicref, ~0);
if (!outpicref)
return AVERROR(ENOMEM);
FF_TPRINTF_START(NULL, start_frame); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " "); ff_tlog_ref(NULL, picref, 1);
+ if (link->closed) {
+ avfilter_unref_buffer(picref);
+ return AVERROR_EOF;
+ }
+
if (!(start_frame = dst->start_frame))
start_frame = default_start_frame;