[FFmpeg-devel] [PATCH]Avoid an assertion failure in ff_init_vlc_sparse
Michael Niedermayer
michaelni at gmx.at
Sat Jul 13 13:53:37 CEST 2013
On Sat, Jul 13, 2013 at 12:22:24PM +0200, Nicolas George wrote:
> Le quintidi 25 messidor, an CCXXI, Carl Eugen Hoyos a écrit :
> > Do you prefer keeping the assert over forwarding
> > the oom error?
>
> I do not know the code well enough to be sure this is indeed possible, but I
> see the assert seems to be triggered by the ENOMEM condition introduced in
> aa74810f. ENOMEM is not an internal bug but an external error condition, and
> therefore can not be checked by an assert.
>
> Therefore, the assert is now wrong, and more precisely it is a remnant of
> the sloppy error checking of the original code that was partially fixed in
> aa74810f. It only needs to be explained in the commit message.
>
> (As a side note, I believe we should agree on a standard format for commit
> messages and try to stick to it. Most other projects that use Git use the
> "context: short impersonal sentence" format, including commits merged from
> libav and a lot of commits from this side. In this particular case, that
> would become something like "lavc/bitstream: replace assert with error
> checks\n\nFix possible assert failures in case of OOM introduced by
> aa74810f.".)
>
> As Michael pointed out, another way of avoiding the assert failure would be
> to avoid the dynamic allocation: if a reasonable upper bound can be found
> for nb_codes, then it can be replaced by a local array. But I do not know
> that this is actually possible, nor that it is the only code path that can
> lead to an error.
patchset implementing this sent
please review
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130713/818b24c9/attachment.asc>
More information about the ffmpeg-devel
mailing list