[FFmpeg-devel] [PATCH] alac: validate k before using show_bits in decode_scalar

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Apr 24 00:15:23 CEST 2015


On 23.04.2015 23:37, Michael Niedermayer wrote:
> On Thu, Apr 23, 2015 at 08:53:29PM +0200, Andreas Cadhalpun wrote:
>> On 23.04.2015 16:37, Michael Niedermayer wrote:
>>> On Wed, Apr 22, 2015 at 06:24:54PM +0200, Andreas Cadhalpun wrote:
>>  libavcodec/alac.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
>> index ffd2d77..16d56a7 100644
>> --- a/libavcodec/alac.c
>> +++ b/libavcodec/alac.c
>> @@ -569,6 +569,10 @@ static int alac_set_info(ALACContext *alac)
>>      alac->rice_history_mult    = bytestream2_get_byteu(&gb);
>>      alac->rice_initial_history = bytestream2_get_byteu(&gb);
>>      alac->rice_limit           = bytestream2_get_byteu(&gb);
>> +    if (!alac->rice_limit) {
>> +        avpriv_request_sample(alac->avctx, "Rice limit 0");
>> +        return AVERROR(ENOSYS);
>> +    }
> 
> this doesnt work as our encoder uses a rice_limit of 0 when
> compression is disabled

I see.

> moving the check into if(is_compressed) should work hopefully

Done.

Best regards,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-alac-reject-rice_limit-0-if-compression-is-used.patch
Type: text/x-diff
Size: 1031 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150424/7a226140/attachment.bin>


More information about the ffmpeg-devel mailing list