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

Paul B Mahol onemda at gmail.com
Thu May 30 20:03:14 CEST 2013


On 5/30/13, Bryce Harrington <bryce at bryceharrington.org> wrote:
> 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?

No, as such can not currently happen.

>
>>      if (size <= 0)
>>          return AVERROR_INVALIDDATA;
>>
>
> Bryce
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list