[FFmpeg-devel] [PATCH 1/3] Support palette information for vobsub's stored as text in extradata
Michael Niedermayer
michaelni at gmx.at
Mon Sep 12 01:09:21 CEST 2011
On Sun, Sep 11, 2011 at 11:27:43PM +0200, Joakim Plate wrote:
>
> >> }
> >>
> >> +static int dvdsub_init(AVCodecContext *avctx)
> >> +{
> >> + DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
> >> + char *data = avctx->extradata;
> >> +
> >> + if (!avctx->extradata || !avctx->extradata_size)
> >> + return 1;
> >> +
> >> + data[avctx->extradata_size] = '\0';
> >
> > this does not look safe
>
> As far as I known, extradata must be padded, so writing one extra byte
> should always be safe. Then again, i'm not sure how well known it is that
> is should be. I suppose i could make a copy of it instead if we don't want
> to rely on padding being present.
thats half of the issue, the other half is that decoders shouldnt
write into their input which extradata is part of
please make a copy of it if this 0 byte is needed
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- 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/20110912/f9e1a2ff/attachment.asc>
More information about the ffmpeg-devel
mailing list