[FFmpeg-devel] Small modifcation to libavformat/dvbsubdec.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Sep 18 19:59:45 CEST 2013


On Wed, Sep 04, 2013 at 10:51:34PM +0100, JULIAN GARDNER wrote:
> diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> index 955925a..faa510a 100644
> --- a/libavcodec/dvbsubdec.c
> +++ b/libavcodec/dvbsubdec.c
> @@ -1015,9 +1015,9 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
>  
>          if (depth & 0x80)
>              clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
> -        if (depth & 0x40)
> +        else if (depth & 0x40)
>              clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
> -        if (depth & 0x20)
> +        else if (depth & 0x20)
>              clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
>      }
>      }

I suggest to apply this, saying that it fixes potential issues with some
encoders.
Maybe it's overkill, but I'd also suggest to apply something in the
style of the patch I sent on top of it, if for no other reason than
to serve as documentation that this is actually badly encoded data.


More information about the ffmpeg-devel mailing list