[FFmpeg-devel] [PATCH]lavc/pcm-bluray: Do not use incompatible pointers on big-endian.

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Nov 1 20:01:10 EET 2017


2017-11-01 18:31 GMT+01:00 Hendrik Leppkes <h.leppkes at gmail.com>:
> On Wed, Nov 1, 2017 at 6:25 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>> 2017-11-01 18:16 GMT+01:00 Hendrik Leppkes <h.leppkes at gmail.com>:
>>> On Wed, Nov 1, 2017 at 5:16 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>>>> Hi!
>>>>
>>>> Attached patch silences two gcc warnings, no sample for odd channel count found.
>>>>
>>>>  #if HAVE_BIGENDIAN
>>>> -                    bytestream2_get_buffer(&gb, dst16, avctx->channels * 2);
>>>> -                    dst16 += avctx->channels;
>>>> +                    uint8_t *dst = frame->data[0];
>>>> +                    bytestream2_get_buffer(&gb, frame->data[0], avctx->channels * 2);
>>>> +                    dst += avctx->channels * 2;
>>>>  #else
>>>>                      channel = avctx->channels;
>>>>                      do {
>>>
>>> This hunk seems fishy. dst is only ever set, never read, and this code
>>> is executed in a loop but always writes to the same position.
>>
>> I had sent the wrong version, please review this one.
>
> That still won't work, dst is declared within the loop, so its reset
> back to the start at the beginning of the frame each iteration.

New try attached.

Thank you, Carl Eugen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-pcm-bluray-Do-not-use-incompatible-pointers-on-.patch
Type: text/x-patch
Size: 1861 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171101/a51a46a4/attachment.bin>


More information about the ffmpeg-devel mailing list