[FFmpeg-devel] [PATCH] lavfi/vf_ass: ignore subtitles decoding errors.

Nicolas George nicolas.george at normalesup.org
Thu Feb 14 19:20:19 CET 2013

Le sextidi 26 pluviôse, an CCXXI, Clement Boesch a écrit :
> I thought it wasn't necessary anymore...

IMHO, checking for bugs is always a good thing.

> OK for this
> Note: I don't think using av_assert1 instead of av_assert0 is really
> relevant.

That does probably not much of a difference indeed.

> As said in the previous mail, I think it's good to allow the subtitles
> decoders to let the AVSubtitle in an incomplete state and prevent anyone
> from reading in it using got_sub_ptr. Or said differently, got_sub_ptr=0
> and sub->num_rects=3 is valid since got_sub_ptr overrules reading anything
> in sub.

I disagree. It is the same principle as using av_freep rather than av_free:
do not let an invalid information hanging somewhere, because even if nobody
is _supposed_ to access it, somebody will eventually, and debugging a null
dereference is easier than debugging an invalid dereference.

AFAIK, all our decoders currently behave correctly according to that check.
I am pretty certain that fixing one that do not behave correctly would be
pretty trivial: it is just a matter of moving sub->num_rects = num_rects
later in the function. May I also remind you that storing anything in the
rectangles would be a memory leak anyway, so I really see no point at all
for behaving like that.


  Nicolas George
-------------- 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/20130214/a51b26bf/attachment.asc>

More information about the ffmpeg-devel mailing list