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

Submitted by Paul B Mahol on Dec. 5, 2018, 1:27 p.m.

Details

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

Commit Message

Paul B Mahol Dec. 5, 2018, 1:27 p.m.
Fixes #4409.

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

Comments

Carl Eugen Hoyos Dec. 5, 2018, 2:37 p.m.
2018-12-05 14:27 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
> Fixes #4409.
>
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/dpx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index 538a1b9943..04b55ffadf 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -378,7 +378,8 @@ static int decode_frame(AVCodecContext *avctx,
>                      read10in32(&buf, &rgbBuffer,
>                                 &n_datum, endian, shift);
>              }
> -            n_datum = 0;
> +            if (packing != 2)
> +                n_datum = 0;
>              for (i = 0; i < elements; i++)
>                  ptr[i] += p->linesize[i];
>          }

This breaks decoding the output of the following command:
$ gm convert converted_image_gets_skewed.dpx -define
dpx:packing-method=b out.dpx

Carl Eugen
Paul B Mahol Dec. 5, 2018, 4:33 p.m.
On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2018-12-05 14:27 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>> Fixes #4409.
>>
>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> ---
>>  libavcodec/dpx.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
>> index 538a1b9943..04b55ffadf 100644
>> --- a/libavcodec/dpx.c
>> +++ b/libavcodec/dpx.c
>> @@ -378,7 +378,8 @@ static int decode_frame(AVCodecContext *avctx,
>>                      read10in32(&buf, &rgbBuffer,
>>                                 &n_datum, endian, shift);
>>              }
>> -            n_datum = 0;
>> +            if (packing != 2)
>> +                n_datum = 0;
>>              for (i = 0; i < elements; i++)
>>                  ptr[i] += p->linesize[i];
>>          }
>
> This breaks decoding the output of the following command:
> $ gm convert converted_image_gets_skewed.dpx -define
> dpx:packing-method=b out.dpx

I do not trust that app, its full of bugs.
Carl Eugen Hoyos Dec. 5, 2018, 4:47 p.m.
2018-12-05 17:33 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
> On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>> 2018-12-05 14:27 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>>> Fixes #4409.
>>>
>>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>>> ---
>>>  libavcodec/dpx.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
>>> index 538a1b9943..04b55ffadf 100644
>>> --- a/libavcodec/dpx.c
>>> +++ b/libavcodec/dpx.c
>>> @@ -378,7 +378,8 @@ static int decode_frame(AVCodecContext *avctx,
>>>                      read10in32(&buf, &rgbBuffer,
>>>                                 &n_datum, endian, shift);
>>>              }
>>> -            n_datum = 0;
>>> +            if (packing != 2)
>>> +                n_datum = 0;
>>>              for (i = 0; i < elements; i++)
>>>                  ptr[i] += p->linesize[i];
>>>          }
>>
>> This breaks decoding the output of the following command:
>> $ gm convert converted_image_gets_skewed.dpx -define
>> dpx:packing-method=b out.dpx
>
> I do not trust that app, its full of bugs.

What is the reference for dpx in your opinion?

Carl Eugen
Paul B Mahol Dec. 5, 2018, 5:19 p.m.
On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2018-12-05 17:33 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>> On 12/5/18, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>>> 2018-12-05 14:27 GMT+01:00, Paul B Mahol <onemda@gmail.com>:
>>>> Fixes #4409.
>>>>
>>>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>>>> ---
>>>>  libavcodec/dpx.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
>>>> index 538a1b9943..04b55ffadf 100644
>>>> --- a/libavcodec/dpx.c
>>>> +++ b/libavcodec/dpx.c
>>>> @@ -378,7 +378,8 @@ static int decode_frame(AVCodecContext *avctx,
>>>>                      read10in32(&buf, &rgbBuffer,
>>>>                                 &n_datum, endian, shift);
>>>>              }
>>>> -            n_datum = 0;
>>>> +            if (packing != 2)
>>>> +                n_datum = 0;
>>>>              for (i = 0; i < elements; i++)
>>>>                  ptr[i] += p->linesize[i];
>>>>          }
>>>
>>> This breaks decoding the output of the following command:
>>> $ gm convert converted_image_gets_skewed.dpx -define
>>> dpx:packing-method=b out.dpx
>>
>> I do not trust that app, its full of bugs.
>
> What is the reference for dpx in your opinion?

ImageTragick certainly not.

Patch hide | download patch | download mbox

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 538a1b9943..04b55ffadf 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -378,7 +378,8 @@  static int decode_frame(AVCodecContext *avctx,
                     read10in32(&buf, &rgbBuffer,
                                &n_datum, endian, shift);
             }
-            n_datum = 0;
+            if (packing != 2)
+                n_datum = 0;
             for (i = 0; i < elements; i++)
                 ptr[i] += p->linesize[i];
         }