Opened 2 years ago
Closed 7 months ago
#2388 closed defect (fixed)
assert failure at libavutil/imgutils.c:350
Reported by: | bug | Owned by: | beastd |
---|---|---|---|
Priority: | normal | Component: | mencoder |
Version: | HEAD | Severity: | normal |
Keywords: | crash | Cc: | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
Hi again,
when running mencoder -ovc lavc -o out.mpeg ./crash, an assert failure is triggered. The following assertion failed.
Assertion ((src_linesize) >= 0 ? (src_linesize) : (-(src_linesize))) >= bytewidth failed at libavutil/imgutils.c:350
This was also tested on a "normal" installation in a natural environment. Please fix this issue, thanks. POC is appended.
Best Regards, Julian aka BitFriends
Attachments (1)
Change History (7)
by , 2 years ago
Attachment: | poc_assert.zip added |
---|
comment:2 by , 2 years ago
nice, thanks for the fix! I'll try to test it for unintended behavior in the next few days. Are those changes included in the recent subversion snapshot?
comment:3 by , 2 years ago
No, I've not committed this one yet, it needs some more thinking and review before that.
comment:4 by , 7 months ago
Status: | new → open |
---|
comment:5 by , 7 months ago
As far a I can tell the patch was committed in August 2022.
SVN-r38370:
mp_image: ensure sufficient space in chroma planes. For odd sized dimensions. Fixes trac issue #2388.
comment:6 by , 7 months ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Closing as this problem should be fixed.
Feel free to re-open should your problem not be fixed.
I am a little concerned about unintended consequences, but this fixes it:
--- libmpcodecs/mp_image.c (revision 38369)
+++ libmpcodecs/mp_image.c (working copy)
@@ -163,6 +163,11 @@
+ ensure enough space for odd sizes
+ if ((mpi->chroma_width << mpi->chroma_x_shift) < mpi->width)
+ ++mpi->chroma_width;
+ if ((mpi->chroma_height << mpi->chroma_y_shift) < mpi->height)
+ ++mpi->chroma_height;
@@ -241,7 +246,7 @@
+ mpi->chroma_height=(mpi->height+1)>>1;