[FFmpeg-devel] [PATCH]lavc/pcm-dvd: Do not use an incompatible pointer on big-endian.

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Nov 6 14:57:16 EET 2017


2017-11-06 11:53 GMT+01:00 Hendrik Leppkes <h.leppkes at gmail.com>:
> On Wed, Nov 1, 2017 at 6:33 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>> 2017-11-01 18:18 GMT+01:00 Hendrik Leppkes <h.leppkes at gmail.com>:
>>> On Wed, Nov 1, 2017 at 5:13 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>>>> Hi!
>>>>
>>>> Attached patch silences a gcc warning, tested with Fever.vob
>>>>
>>>>
>>>> @@ -163,10 +162,12 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
>>>>     switch (avctx->bits_per_coded_sample) {
>>>>     case 16: {
>>>> #if HAVE_BIGENDIAN
>>>> +        int8_t *dst16 = dst;
>>>>         bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
>>>> -        dst16 += blocks * s->block_size / 2;
>>>> +        dst16 += blocks * s->block_size;
>>>> #else
>>>>         int samples = blocks * avctx->channels;
>>>> +        int16_t *dst16 = dst;
>>>>         do {
>>>>             *dst16++ = bytestream2_get_be16u(&gb);
>>>>         } while (--samples);
>>>
>>> This results in quite misleading code. dst16 is named like that
>>> because its a 16-bit pointer, using the same pointer with different
>>> types based on this ifdef seems error-prone in the future.
>>
>> Agree, new patch attached.
>
> I think you attached the wrong patch, this is an old version of the
> pcm-bluray patch.

New try attached.

Thank you, Carl Eugen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-pcm-dvd-Do-not-use-an-incompatible-pointer-on-b.patch
Type: text/x-patch
Size: 1651 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171106/5c61972b/attachment.bin>


More information about the ffmpeg-devel mailing list