[FFmpeg-devel] avcodec/dpx: do not reset n_datum to 0 at end of row

Submitted by Paul B Mahol on Dec. 5, 2018, 10:30 a.m.

Details

Message ID 20181205103059.26109-1-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Dec. 5, 2018, 10:30 a.m.
Fixes #4409.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/dpx.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Carl Eugen Hoyos Dec. 5, 2018, 11:47 a.m.
2018-12-05 11:30 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
> Fixes #4409.
>
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/dpx.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index 538a1b9943..b09f65eeb6 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -378,7 +378,6 @@ static int decode_frame(AVCodecContext *avctx,
>                      read10in32(&buf, &rgbBuffer,
>                                 &n_datum, endian, shift);
>              }
> -            n_datum = 0;
>              for (i = 0; i < elements; i++)
>                  ptr[i] += p->linesize[i];
>          }
> @@ -413,7 +412,6 @@ static int decode_frame(AVCodecContext *avctx,
>                                                 &n_datum, endian);
>                  }
>              }
> -            n_datum = 0;

This breaks existing files.

Carl Eugen
Paul B Mahol Dec. 5, 2018, 11:49 a.m.
On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2018-12-05 11:30 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>> Fixes #4409.
>>
>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> ---
>>  libavcodec/dpx.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
>> index 538a1b9943..b09f65eeb6 100644
>> --- a/libavcodec/dpx.c
>> +++ b/libavcodec/dpx.c
>> @@ -378,7 +378,6 @@ static int decode_frame(AVCodecContext *avctx,
>>                      read10in32(&buf, &rgbBuffer,
>>                                 &n_datum, endian, shift);
>>              }
>> -            n_datum = 0;
>>              for (i = 0; i < elements; i++)
>>                  ptr[i] += p->linesize[i];
>>          }
>> @@ -413,7 +412,6 @@ static int decode_frame(AVCodecContext *avctx,
>>                                                 &n_datum, endian);
>>                  }
>>              }
>> -            n_datum = 0;
>
> This breaks existing files.

Have proof? Link to such existing files?
Carl Eugen Hoyos Dec. 5, 2018, 12:10 p.m.
2018-12-05 12:49 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
> On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>> 2018-12-05 11:30 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>>> Fixes #4409.
>>>
>>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>>> ---
>>>  libavcodec/dpx.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
>>> index 538a1b9943..b09f65eeb6 100644
>>> --- a/libavcodec/dpx.c
>>> +++ b/libavcodec/dpx.c
>>> @@ -378,7 +378,6 @@ static int decode_frame(AVCodecContext *avctx,
>>>                      read10in32(&buf, &rgbBuffer,
>>>                                 &n_datum, endian, shift);
>>>              }
>>> -            n_datum = 0;
>>>              for (i = 0; i < elements; i++)
>>>                  ptr[i] += p->linesize[i];
>>>          }
>>> @@ -413,7 +412,6 @@ static int decode_frame(AVCodecContext *avctx,
>>>                                                 &n_datum, endian);
>>>                  }
>>>              }
>>> -            n_datum = 0;
>>
>> This breaks existing files.
>
> Have proof?

Seriously?

> Link to such existing files?

http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2392/converted_image_gets_skewed.dpx
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket5639/odd_12bpp.dpx
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket5639/odd_12bpp_alpha.dpx

Carl Eugen

Patch hide | download patch | download mbox

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 538a1b9943..b09f65eeb6 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -378,7 +378,6 @@  static int decode_frame(AVCodecContext *avctx,
                     read10in32(&buf, &rgbBuffer,
                                &n_datum, endian, shift);
             }
-            n_datum = 0;
             for (i = 0; i < elements; i++)
                 ptr[i] += p->linesize[i];
         }
@@ -413,7 +412,6 @@  static int decode_frame(AVCodecContext *avctx,
                                                &n_datum, endian);
                 }
             }
-            n_datum = 0;
             for (i = 0; i < elements; i++)
                 ptr[i] += p->linesize[i];
             // Jump to next aligned position