[vlc-devel] [vlc-commits] picture: set a maximum alloc size for sw buffers
Thomas Guillem
thomas at gllm.fr
Wed Nov 15 15:57:24 CET 2017
On Wed, Nov 15, 2017, at 15:54, Rémi Denis-Courmont wrote:
> Le 15 novembre 2017 15:58:09 GMT+02:00, Thomas Guillem <git at videolan.org>
> a écrit :
> >vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Nov 15
> >14:57:31 2017 +0100| [47ae93bdb7b2334afbef16bbf8836cdfadc09159] |
> >committer: Thomas Guillem
> >
> >picture: set a maximum alloc size for sw buffers
> >
> >>
> >http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47ae93bdb7b2334afbef16bbf8836cdfadc09159
> >---
> >
> > src/misc/picture.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> >diff --git a/src/misc/picture.c b/src/misc/picture.c
> >index c14e600d3f..f6671edd51 100644
> >--- a/src/misc/picture.c
> >+++ b/src/misc/picture.c
> >@@ -38,6 +38,8 @@
> > #include <vlc_image.h>
> > #include <vlc_block.h>
> >
> >+#define PICTURE_SW_SIZE_MAX (1<<28) /* 256MB: 8K * 8K * 4*/
> >+
> > /**
> > * Allocate a new picture in the heap.
> > *
> >@@ -62,6 +64,12 @@ static int AllocatePicture( picture_t *p_pic )
> > i_bytes += p->i_pitch * p->i_lines;
> > }
> >
> >+ if( i_bytes >= PICTURE_SW_SIZE_MAX )
> >+ {
> >+ p_pic->i_planes = 0;
> >+ return VLC_ENOMEM;
> >+ }
> >+
> > uint8_t *p_data = aligned_alloc( 16, i_bytes );
> > if( i_bytes > 0 && p_data == NULL )
> > {
> >
> >_______________________________________________
> >vlc-commits mailing list
> >vlc-commits at videolan.org
> >https://mailman.videolan.org/listinfo/vlc-commits
>
> YUV 4:4:4 HDR is 6 bytes per pixel. RGB(A) may even be 8 bpp.
OK, so, 256MB for a software picture is not enough?
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser
> ma brièveté.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list