[FFmpeg-devel] [PATCH] Bluray Subtitle Support, v5

Michael Niedermayer michaelni
Sun Aug 2 17:11:53 CEST 2009


On Sun, Aug 02, 2009 at 12:15:35PM +1000, stev391 at exemail.com.au wrote:
> On Tue, 2009-07-28 at 22:28 +0200, Michael Niedermayer wrote:
[...]
> > [...]
> > > +static void pgssub_parse_palette_segment(AVCodecContext *avctx,
> > > +                                         const uint8_t *buf, int buf_size)
> > > +{
> > > +    PGSSubContext *ctx = (PGSSubContext*) avctx->priv_data;
> > > +
> > > +    const uint8_t *buf_end = buf + buf_size;
> > > +    int colour_id, max_colour_id;
> > > +    int y, cb, cr, alpha;
> > > +    int r, g, b, r_add, g_add, b_add;
> > > +
> > > +    max_colour_id = (buf_size - 2) % 5;
> > > +
> > > +    /* Check to ensure that the buffer provided is not larger then the maximum palette */
> > > +    if (max_colour_id > 255) {
> > > +        av_log(avctx, AV_LOG_INFO, "Palette Packet too large, pontentially %d colours defined.\n",
> > > +               max_colour_id);
> > > +        return;
> > 
> > unreachable
> This is reachable if it is a mangled packet, but as I check the colour
> index further down, this is redundant.  Removed and replaced with error
> message if colour index is too large.

X % 5 is not > 255


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090802/e8ea0dfb/attachment.pgp>



More information about the ffmpeg-devel mailing list