[FFmpeg-devel] [PATCH] avutil/dict: Print warning in case av_dict_set() fails to allocate memory
Michael Niedermayer
michaelni at gmx.at
Sun Jun 28 19:11:58 CEST 2015
On Sun, Jun 28, 2015 at 06:54:50PM +0200, Nicolas George wrote:
> Le decadi 10 messidor, an CCXXIII, Michael Niedermayer a écrit :
> > i understand that but taking the burden off the caller to print an
> > error for memory allocation failures seemed overall to be the
> > correct thing to do in this case
> >
> > if thats not wanted iam happy to drop this patch, it was just a
> > suggestion as it seemed like the right thing to do in this case and
> > alot simpler than the other way around
>
> Something I thought of after sending my first mail:
>
> Printing a specific warning for a small memory allocation failure is
> useless. Small memory allocations do not fail under normal circumstances,
> due to over commit. And even if the circumstances make they do fail, a whole
> lot of them will fail, making the output fail at best, corrupted at work,
> and in any case, cluttering the log with specific places of failure is not
> helpful.
i had somehow implicitly assumed that the allocation would be
big like somethig passing several megabyte long strings to
av_set_dict().
Knowing about this when debuging could be usefull as its not the
normal / sane thing that should happen, it might indicate that
something is passed into av_set_dict() that shouldnt have been
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150628/e2b46d6b/attachment.asc>
More information about the ffmpeg-devel
mailing list