Quoting Andreas Rheinhardt (2022-07-06 15:08:05) > Anton Khirnov: > > Quoting Andreas Rheinhardt (2022-07-05 22:09:37) > >> av_fast_realloc and av_fast_mallocz? store the size of > >> the objects they allocate in an unsigned. Yet they overallocate > >> and currently they can allocate more than UINT_MAX bytes > >> in case a user has requested a size of about UINT_MAX * 16 / 17 > >> or more if SIZE_MAX > UINT_MAX. In this case it is impossible > >> to store the true size of the buffer via the unsigned*; > >> future requests are likely to use the (re)allocation codepath > >> even if the buffer is actually large enough because of > >> the incorrect size. > >> > >> Fix this by ensuring that the actually allocated size > >> always fits into an unsigned. (This entails erroring out > >> in case the user requested more than UINT_MAX.) > > > > I really dislike this av_fast_* naming. > > > > Given that all these functions use unsigned int for something that > > should really be size_t, how about we deprecate them all and replace > > with something that has a sane naming convention and uses proper types? > > > > What name do you suggest?
I suggested av_?alloc*_reuse() in a recent thread, since those function are "fast" by reusing the buffer when possible. > And what's your opinion of the actual patch? Seems straightforwardly ok. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".