[FFmpeg-devel] [PATCH 3/4] libavcodec: return specific error code on subtitles with invalid UTF-8

Nicolas George nicolas.george at normalesup.org
Thu Aug 8 01:25:05 CEST 2013

Le primidi 21 thermidor, an CCXXI, wm4 a écrit :
> It could be argued that an application should test the input for valid
> UTF-8 before passing it to libavcodec, but the input could be binary
> (e.g. movtext), and libavcodec checks the text _after_ decoding it.

The point of this check is to guarantee that lavc will only return valid
UTF-8 to the application. If it does not, it is a decoder bug, but the text
decoders are still too sloppy for that check to be made an assert and cause
a hard crash, or event for AVERROR_BUG.

> It would be much more useful if libavcodec just returned the (broken)
> subtitle anyway, but such a patch was rejected earlier.

This is still work in progress, returning the invalid data would be a step
backward. I have already pointed you towards changes that would actually
help to get an API that actually works and not just "I want my broken setup
to work right now, I do not care how many kludges need to be piled on top of
each other".

> +                    return FFERRTAG('N', 'I', 'C', 'O');

Errors do not work that way.


  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/20130808/da37d9c8/attachment.asc>

More information about the ffmpeg-devel mailing list