[FFmpeg-devel] [PATCH] Make av_base64_decode() fail if the input sequence is invalid

Stefano Sabatini stefano.sabatini-lala
Sat Jan 24 23:18:05 CET 2009


currently av_base64_decode() doesn't fail with invalid data of the
kind "M", "M==M==", "M===".

Though I'm not sure the patch implements a good idea, maybe the
decoder should be tolerant and accept not perfectly legal but on the
other end meaningful inputs (for example "MQ" although not legal is
perfectly equivalent for the decoder to "MQ=="), anyway in this case
we cannot use the function av_base64_decode() to validate data.

An idea could be to add a flag like this:
int av_base64_decode2(uint8_t * out, const char *in, int out_length, int validate)

but maybe this is overkill.

Opinions are welcome.

FFmpeg = Forgiving Fiendish Merciful Patchable Elastic Guru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-base64-decode-check.patch
Type: text/x-diff
Size: 593 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090124/a5de7ab2/attachment.patch>

More information about the ffmpeg-devel mailing list