Skip to content

Bypass scaling skip for mono 8 bit images - #41

Merged
coretl merged 1 commit into
areaDetector:masterfrom
jsouter:scale-mono-8bit
Sep 4, 2026
Merged

Bypass scaling skip for mono 8 bit images#41
coretl merged 1 commit into
areaDetector:masterfrom
jsouter:scale-mono-8bit

Conversation

@jsouter

@jsouter jsouter commented Jun 27, 2025

Copy link
Copy Markdown

With the mjpeg codec in use at Diamond, we have been seeing the following crash:

Assertion ((src_linesize) >= 0 ? (src_linesize) : (-(src_linesize))) >= bytewidth failed at src/libavutil/imgutils.c:350

for 8 bit mono images when entering the logic block that returns early from formatArray without performing sws_scale. This crash did not occur before the deprecated API calls were replaced. With some quick benchmarks on my workstation I couldn't see any appreciable change in cpu usage when bypassing this logic, @coretl and I discussed that the simplest solution may be to just scale all images to prevent this crash, though if there are other suggestions I can amend this - for the specific codec I have been testing with the crash can be avoided by setting the stride variable to 2 or 1.

@pgap

pgap commented Sep 2, 2026

Copy link
Copy Markdown

We are seeing the same crash at ESS, with ffmpeg versions 6.1 and 7.1. I can confirm that this change avoids the assertion.

@coretl

coretl commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I guess we can merge this then

@coretl
coretl merged commit de5d7f9 into areaDetector:master Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants