Fix #111642: VSE glow code can overflow with small proxies #111660

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:111642 into main 2023-08-30 10:24:51 +02:00
Member

With such small proxy sizes (combined with a small blur radius), the
kernels halfWidth can get zero, which leads to a memory allocation of
same zero size and writing to that memory leads to overflow/crashes/can
only go downhill from there.

Now early out in such cases [which leads to
slightly different output -- well if the "buggy" output survives and
does not crash that is].

(alternatively we could just prevent the overflow and still let do
RVBlurBitmap2_float do stuff that it really shouldnt imo, see first version of the PR)

With such small proxy sizes (combined with a small blur radius), the kernels `halfWidth` can get zero, which leads to a memory allocation of same zero size and writing to that memory leads to overflow/crashes/can only go downhill from there. Now early out in such cases [which leads to slightly different output -- well if the "buggy" output survives and does not crash that is]. (alternatively we could just prevent the overflow and still let do `RVBlurBitmap2_float` do stuff that it really shouldnt imo, see first version of the PR)
Philipp Oeser added 1 commit 2023-08-29 16:58:42 +02:00
With such small proxy sizes (combined with a small blur radius), the
kernels `halfWidth` can get zero, which leads to a memory allocation of
same zero size and writing to that memory leads to overflow/crashes/cn
only go downhill from there.

The preferred fix would be to early out in such cases [which leads to
slightly different output -- well if the "buggy" output survives and
does not crash that is].

(alternatively we could just prevent the overflow and still let do
`RVBlurBitmap2_float` do stuff that it really should imo -- left the
alternative fix in this patch for the time being)
Philipp Oeser added this to the Video Sequencer project 2023-08-29 16:59:12 +02:00
Philipp Oeser requested review from Richard Antalik 2023-08-29 16:59:26 +02:00
Philipp Oeser requested review from Sergey Sharybin 2023-08-29 16:59:33 +02:00
Sergey Sharybin approved these changes 2023-08-29 17:07:11 +02:00

I would rather do early out. Better solution would be to define this early out as callback function in get_sequence_effect_impl() though.

I would rather do early out. Better solution would be to define this early out as callback function in `get_sequence_effect_impl()` though.
Author
Member

I would rather do early out. Better solution would be to define this early out as callback function in get_sequence_effect_impl() though.

That would probably change the output even more compared to old behavior (since it would then also skip RVIsolateHighlights_float, not only RVBlurBitmap2_float -- though that is probably even more correct?)

> I would rather do early out. Better solution would be to define this early out as callback function in `get_sequence_effect_impl()` though. That would probably change the output even more compared to old behavior (since it would then also skip `RVIsolateHighlights_float`, not only `RVBlurBitmap2_float` -- though that is probably even more correct?)
Author
Member

I would rather do early out. Better solution would be to define this early out as callback function in get_sequence_effect_impl() though.

That would probably change the output even more compared to old behavior (since it would then also skip RVIsolateHighlights_float, not only RVBlurBitmap2_float -- though that is probably even more correct?)

Note there is also another "early out" already in RVBlurBitmap2_float, see /* If we're not really blurring, bail out */ in current main

> > I would rather do early out. Better solution would be to define this early out as callback function in `get_sequence_effect_impl()` though. > > That would probably change the output even more compared to old behavior (since it would then also skip `RVIsolateHighlights_float`, not only `RVBlurBitmap2_float` -- though that is probably even more correct?) Note there is also another "early out" already in `RVBlurBitmap2_float`, see `/* If we're not really blurring, bail out */` in current main
Richard Antalik approved these changes 2023-08-29 18:33:34 +02:00

I would rather do early out. Better solution would be to define this early out as callback function in get_sequence_effect_impl() though.

That would probably change the output even more compared to old behavior (since it would then also skip RVIsolateHighlights_float, not only RVBlurBitmap2_float -- though that is probably even more correct?)

Note there is also another "early out" already in RVBlurBitmap2_float, see /* If we're not really blurring, bail out */ in current main

If image is still modified in some way, then I am fine with early return as bugfix.

> > > I would rather do early out. Better solution would be to define this early out as callback function in `get_sequence_effect_impl()` though. > > > > That would probably change the output even more compared to old behavior (since it would then also skip `RVIsolateHighlights_float`, not only `RVBlurBitmap2_float` -- though that is probably even more correct?) > > Note there is also another "early out" already in `RVBlurBitmap2_float`, see `/* If we're not really blurring, bail out */` in current main If image is still modified in some way, then I am fine with early return as bugfix.
Philipp Oeser added 1 commit 2023-08-30 09:55:28 +02:00
Philipp Oeser merged commit f77fdbff8a into main 2023-08-30 10:24:51 +02:00
Philipp Oeser deleted branch 111642 2023-08-30 10:24:52 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111660
No description provided.