Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-25 Thread Michael Niedermayer
On Sat, Aug 24, 2019 at 02:37:49PM +0200, Nicolas George wrote: > Juan De León (12019-08-23): > > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > > AV_FRAME_DATA_ENCODE_INFO. > > The structure stores quantization index for each plane, DC/AC deltas > > for luma and chroma

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-24 Thread Nicolas George
Juan De León (12019-08-23): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Juan De León
On Fri, Aug 23, 2019 at 12:28 PM Nicolas George wrote: > Juan De León (12019-08-23): > > I changed it to an inline function, returns SIZE_MAX if it fails to make > > av_malloc() fail and return NULL. > > You neglected to check for SIZE_MAX afterwards. I suspect there are > architectures where

[FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Juan De León
AVEncodeInfoFrame data structure to store as AVFrameSideData of type AV_FRAME_DATA_ENCODE_INFO. The structure stores quantization index for each plane, DC/AC deltas for luma and chroma planes, and an array of AVEncodeInfoBlock type denoting position, size, and delta quantizer for each block in the

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Nicolas George
Juan De León (12019-08-23): > I changed it to an inline function, returns SIZE_MAX if it fails to make > av_malloc() fail and return NULL. You neglected to check for SIZE_MAX afterwards. I suspect there are architectures where such a malloc could succeed. If you insist on a function rather than

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Juan De León
On Fri, Aug 23, 2019 at 8:07 AM Nicolas George wrote: > > +if (nb_blocks - 1 > (SIZE_MAX - sizeof(AVEncodeInfoFrame)) / > sizeof(AVEncodeInfoBlock)) > > +return NULL; > > nb_blocks - 1 overflows for 0. Move the -1 right of the = as +1. > > > +//AVEncodeInfoFrame already allocates

[FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Juan De León
AVEncodeInfoFrame data structure to store as AVFrameSideData of type AV_FRAME_DATA_ENCODE_INFO. The structure stores quantization index for each plane, DC/AC deltas for luma and chroma planes, and an array of AVEncodeInfoBlock type denoting position, size, and delta quantizer for each block in the

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-23 Thread Nicolas George
Juan De León (12019-08-21): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

[FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-21 Thread Juan De León
AVEncodeInfoFrame data structure to store as AVFrameSideData of type AV_FRAME_DATA_ENCODE_INFO. The structure stores quantization index for each plane, DC/AC deltas for luma and chroma planes, and an array of AVEncodeInfoBlock type denoting position, size, and delta quantizer for each block in the

Re: [FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-21 Thread Nicolas George
Juan De León (12019-08-19): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

[FFmpeg-devel] [PATCH 1/3] libavutil: AVEncodeInfo data structures

2019-08-19 Thread Juan De León
AVEncodeInfoFrame data structure to store as AVFrameSideData of type AV_FRAME_DATA_ENCODE_INFO. The structure stores quantization index for each plane, DC/AC deltas for luma and chroma planes, and an array of AVEncodeInfoBlock type denoting position, size, and delta quantizer for each block in the