[FFmpeg-devel] [PATCH] asf - read/write metadata as UTF-16

Anton Khirnov wyskas
Mon Feb 22 19:42:18 CET 2010


On Mon, Feb 22, 2010 at 05:24:52PM +0100, Michael Niedermayer wrote:
> 
> id say validating the stuff should happen somewhere else, how did
> invalid values reach that point to begin with?
> also your error checking in utf16 is highly incomple, missing checks
> for surrogate pairs at least
> 
ok, removed
> 
> are you sure its unicode characters and not bytes/2
> (needs surrogate pairs to seperate ...)
> 
specs say "unicode characters", tests with wmp show it's actually
bytes/2. updated comment to reflect that.
> 
> what is it now? characters? if so 2*len is not enough not all characters
> can be stored in 2 bytes.
> 
2*(length in bytes of UTF-16 input) >= length in bytes of UTF-8 output
> [...]
> > @@ -157,12 +160,12 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len)
> >      if ((unsigned)len >= UINT_MAX)
> >          return;
> >  
> > -    value = av_malloc(len+1);
> > +    value = av_malloc(2*len+1);
> 
> integer overflow
> 
fixed

Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-PUT_UTF16-macro.patch
Type: text/x-diff
Size: 1794 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-asfenc-eliminate-put_str16.patch
Type: text/x-diff
Size: 1779 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-asf-don-t-add-WM-prefix-to-all-tags.patch
Type: text/x-diff
Size: 1753 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-asfenc-simplify-writing-of-comment-header.patch
Type: text/x-diff
Size: 3001 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-asfenc-write-tags-in-proper-UTF-16.patch
Type: text/x-diff
Size: 4220 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-asfdec-read-metadata-as-proper-UTF-16.patch
Type: text/x-diff
Size: 2055 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment-0005.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4ddef3eb/attachment.pgp>



More information about the ffmpeg-devel mailing list