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

Clément Bœsch ubitux at gmail.com
Wed Feb 13 17:29:04 CET 2013


On Wed, Feb 13, 2013 at 05:17:14PM +0100, Nicolas George wrote:
> Le quintidi 25 pluviôse, an CCXXI, Clement Boesch a écrit :
> > I'm not sure about removing the got_subtitle check. You might read again
> > from the previous decoded sub (if any).
> 
> avcodec_decode_subtitle2() calls avcodec_get_subtitle_defaults(), which sets
> num_rects to 0 amongst other things.
> 
> (And patch 2/2 ensures that a bogus decoder will not return num_rects != 0
> without setting got_subtitle to 1.)
> 
> Therefore, I believe it is safe.
> 

I'd be more comfortable with a:

  if (ret < 0) {
      av_log(...)
  } else {
      for (i = 0; i < sub->num_rects; i++)
          ...
  }

...because in the decoder, it might makes sense to not cleanup the sub
content in case of error (certainly simpler). got_subtitle IMO overrules
anything in sub.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130213/2976a345/attachment.asc>


More information about the ffmpeg-devel mailing list