[FFmpeg-devel] [libav-devel] [PATCH] libopenjpegdec: check existence of image component data

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sat May 30 20:00:30 CEST 2015


On 30.05.2015 19:09, Michael Bradshaw wrote:
> On Sat, May 30, 2015 at 7:50 AM, Andreas Cadhalpun <
> andreas.cadhalpun at googlemail.com> wrote:
> 
>> On 30.05.2015 16:41, Luca Barbato wrote:
>>> Do you happen to know why it does do that?
>>
>> It encounters a problem, but only warns about it and returns the image
>> anyway. The warning is not sent to stdout with libavcodec, but can be seen
>> with j2k_dump:
>> [WARNING] 0000006a: expected a marker instead of 0
> 
> 
> Then perhaps a opj_event_mgr_t event handler should be registered. The
> openjpeg encoder does this to log all warnings with av_log.

That's a good idea, thanks for the hint. Patch implementing this is attached.
With this and the previous patch the error messages are:
[libopenjpeg @ 0xe48f20] read error: passed the end of the codestream (start = 14964064, current = 14964172, end = 14964172
    Last message repeated 1 times
[libopenjpeg @ 0xe48f20] 0000006a: expected a marker instead of 0
[libopenjpeg @ 0xe48f20] read error: passed the end of the codestream (start = 14964064, current = 14964172, end = 14964172
    Last message repeated 1 times
[libopenjpeg @ 0xe48f20] 0000006a: expected a marker instead of 0
[libopenjpeg @ 0xe48f20] Image component 0 contains no data.

> But if openjpeg
> is giving back bad data without a warning/error code from the returning
> function, then perhaps this error check is justified.

Well, the function returns a pointer, so the only warning/error code is
returning NULL.

Best regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libopenjpegdec-register-logging-callback-functions.patch
Type: text/x-diff
Size: 2054 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150530/a583f80c/attachment.bin>


More information about the ffmpeg-devel mailing list