diff options
Diffstat (limited to 'libavfilter/defaults.c')
-rw-r--r-- | libavfilter/defaults.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c index 5b1d5b86a6..2140436e8d 100644 --- a/libavfilter/defaults.c +++ b/libavfilter/defaults.c @@ -39,9 +39,10 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per int i, tempsize; char *buf; - ref->buf = pic; - ref->w = w; - ref->h = h; + ref->buf = pic; + ref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps)); + ref->video->w = w; + ref->video->h = h; /* make sure the buffer gets read permission or it's useless for output */ ref->perms = perms | AV_PERM_READ; @@ -49,15 +50,15 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per pic->refcount = 1; ref->format = link->format; pic->free = avfilter_default_free_buffer; - av_fill_image_linesizes(pic->linesize, ref->format, ref->w); + av_fill_image_linesizes(pic->linesize, ref->format, ref->video->w); for (i=0; i<4;i++) pic->linesize[i] = FFALIGN(pic->linesize[i], 16); - tempsize = av_fill_image_pointers(pic->data, ref->format, ref->h, NULL, pic->linesize); + tempsize = av_fill_image_pointers(pic->data, ref->format, ref->video->h, NULL, pic->linesize); buf = av_malloc(tempsize + 16); // +2 is needed for swscaler, +16 to be // SIMD-friendly - av_fill_image_pointers(pic->data, ref->format, ref->h, buf, pic->linesize); + av_fill_image_pointers(pic->data, ref->format, ref->video->h, buf, pic->linesize); memcpy(ref->data, pic->data, 4*sizeof(pic->data[0])); memcpy(ref->linesize, pic->linesize, 4*sizeof(pic->linesize[0])); |