From 2c23c840cc15a2d8c336db9e69a2ba633962adb4 Mon Sep 17 00:00:00 2001
From: Sebastian Krzyszkowiak <dos@dosowisko.net>
Date: Fri, 29 Sep 2023 07:19:15 +0200
Subject: [PATCH] video_mpeg: Wrap in ctx_save/restore pair

---
 components/video_mpeg/video_mpeg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/video_mpeg/video_mpeg.c b/components/video_mpeg/video_mpeg.c
index 7a18312e46..e6cba16cbb 100644
--- a/components/video_mpeg/video_mpeg.c
+++ b/components/video_mpeg/video_mpeg.c
@@ -155,6 +155,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) {
                     ctx_gray(ctx, 0.0);
                     ctx_fill(ctx);
                 }
+                ctx_save(ctx);
                 ctx_translate(ctx, -dim / 2, -dim / 2);
                 ctx_translate(ctx, (dim - mpg1->width * scale) / 2.0 + cx,
                               (dim - mpg1->height * scale) / 2.0 + cy);
@@ -167,6 +168,7 @@ static void mpg1_draw(st3m_media *media, Ctx *ctx) {
                 ctx_image_smoothing(ctx, false);
                 ctx_compositing_mode(ctx, CTX_COMPOSITE_COPY);
                 ctx_fill(ctx);
+                ctx_restore(ctx);
             }
         } else {
             ctx_rgb(ctx, 0.2, 0.3, 0.4);
-- 
GitLab