[FFmpeg-devel] [PATCH] dvb subtitle decoder doesn'tsetnb_colors correctly
elupus
elupus
Mon Nov 19 20:07:21 CET 2007
"Ian Caulfield" <ian.caulfield at gmail.com> wrote in message
news:27bbfebe0711190232i5609fc77rca50eb217f741da0 at mail.gmail.com...
> On Nov 18, 2007 1:42 PM, elupus <elupus at ecce.se> wrote:
>> "Ian Caulfield" <ian.caulfield at gmail.com> wrote in message
>> news:27bbfebe0711180524y4f8b063emfeb3a44a2c4c1d1e at mail.gmail.com...
>> > Do you have any samples that fail?
>> >
>> > Ian
>>
>>
>> Nope can't say i do. Stumbled on it while debugging another issue I was
>> having. But the palette is later allocated using:
>>
>> rect->rgba_palette = av_malloc((1 << region->depth) * sizeof(uint32_t));
>>
>> So unless you know how many colors there are in the palette, you end up
>> risking accessing non allocated data, if the actually image data contains
>> references to palette colors outside the number you have allocated.
>
> Yep - your fix looks fine, but a test case is always good! Hopefully
> non-mangled patch attached.
>
> What was the other issue you were encountering?
>
Unrelated to ffmpeg, i was accessing colors way outside the palette. Copied
a palette using char* [i <<4] instead of char*[i*4], or similar don't
remember exactly. So ofcourse I blamed ffmpeg, and indeed found a bug. Not
the one i was looking for but hey :)
Btw, what is mangled in that patch? I've looked at it both from my nntp
client, and from gmane and couldn't see any oddness. I'm not saying there
wasn't, cause it did look odd indeed in mikes reply.
/Joakim
More information about the ffmpeg-devel
mailing list