[libav-devel] [PATCH 1/2] smacker: add sanity check for length in smacker_decode_tree()

Sean McGovern gseanmcg at gmail.com
Sat Nov 11 02:10:53 CET 2017


On Thu, Nov 9, 2017 at 9:28 AM, Diego Biurrun <diego at biurrun.de> wrote:
> On Thu, Nov 09, 2017 at 03:27:10PM +0100, Diego Biurrun wrote:
>> On Wed, Nov 08, 2017 at 07:22:53PM -0500, Sean McGovern wrote:
>> > --- a/libavcodec/smacker.c
>> > +++ b/libavcodec/smacker.c
>> > @@ -97,6 +97,11 @@ enum SmkBlockTypes {
>> >  static int smacker_decode_tree(BitstreamContext *bc, HuffContext *hc,
>> >                                 uint32_t prefix, int length)
>> >  {
>> > +    if (length > SMKTREE_DECODE_MAX_RECURSION) {
>> > +        av_log(NULL, AV_LOG_ERROR, "length too long\n");
>>
>> "Maximum recursion level exceeded.\n"
>
> Better:
>
> "Maximum tree recursion level exceeded.\n"
>
> Diego

OK, fixing this and 2/2 locally and will push shortly.

-- Sean McG.


More information about the libav-devel mailing list