[FFmpeg-devel] [PATCH] tiff: planar rgb

Bryce Harrington bryce at bryceharrington.org
Thu May 30 07:36:43 CEST 2013


On Tue, May 28, 2013 at 04:28:00PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/tiff.c | 44 +++++++++++++++++++++++++++++---------------
>  1 file changed, 29 insertions(+), 15 deletions(-)
> 
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 6c2dc23..0b46cbd 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -52,6 +52,7 @@ typedef struct TiffContext {
>      int le;
>      enum TiffCompr compr;
>      int invert;
> +    int planar;
>      int fax_opts;
>      int predictor;
>      int fill_order;
> @@ -418,6 +419,9 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
>      const uint8_t *ssrc = src;
>      int width = ((s->width * s->bpp) + 7) >> 3;
>  
> +    if (s->planar)
> +        width /= s->bppcount;
> +

Would it be worth also checking that s->bppcount != 0 here?

>      if (size <= 0)
>          return AVERROR_INVALIDDATA;
>  

Bryce


More information about the ffmpeg-devel mailing list