TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.54K subscribers
Post #20644 107
UnigramDev/Unigram/develop • fd6442f • 1 files, +5/-1
Discard the video resources when the rendering device is replaced (#3350)

VoipVideoOutput's RenderingDeviceReplaced handler only flipped m_resourcesValid
back on, keeping the YUV420 effect and its three input bitmaps, all of which were
realized on the device that had just been replaced. The next frame of the same
size copied into those bitmaps and drew the effect on a context BeginDraw returned
from the new device, which fails with D2DERR_WRONG_RESOURCE_DOMAIN, "The resource
was realized on the wrong render target".

Call the existing ReleaseShader() from the handler, under the m_deviceMutex it
already holds, so the next frame recreates everything against the new device. The
sibling surfaces already do this: FreeformGradientSurface nulls its bitmap and
re-invalidates, and MessageBubbleNineGrid caches no device-bound resources.

Also fix a self-comparison in RenderFrame: finalSize.cy was compared with itself
instead of m_surfaceSize.cy, so a height-only change never resized the drawing
surface.

Reported by crash telemetry on 12.9.1.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

#unigram
More from @tgappsupdates
  1. Oct 13, 2026telegramdesktop/tdesktop/dev • 3c9f6ee • 1 files, +8/-8 Bump actions/download-artifact fro…
  2. Oct 13, 2026TGX-Android/Telegram-X/main • e8a46a1 • 3 files, +27/-7 Update `.gitmodules` #tgxandroid
  3. Oct 13, 2026UnigramDev/Unigram/develop • 7842fff • 5 files, +1215/-148 Group the rich editor toolbar's…
  4. Oct 13, 2026UnigramDev/Unigram/develop • c04c03a • 2 files, +53/-9 Map spell checking and collapsible…
  5. Oct 13, 2026UnigramDev/Unigram/develop • 5b57a69 • 1 files, +1/-0 Fix event unsubscribe UnigramDev/Uni…
  6. Oct 13, 2026TelegramMessenger/tgcalls/dev/android • 03d7b86 • 1 files, +28/-1 v2: defer camera renegot…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →