media: vivid: free bitmap_cap when updating std/timings/etc.
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 9 Nov 2018 13:37:44 +0000 (08:37 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 23 Nov 2018 11:23:40 +0000 (06:23 -0500)
When vivid_update_format_cap() is called it should free any overlay
bitmap since the compose size will change.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+0cc8e3cc63ca373722c6@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # for v3.18 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vivid/vivid-vid-cap.c

index 8213297ee9dc766885f7dd4342547e158f6c68d5..a1ed5fdabc75cc7fa740d7c0f32d33299d6adb5d 100644 (file)
@@ -451,6 +451,8 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls)
                tpg_s_rgb_range(&dev->tpg, v4l2_ctrl_g_ctrl(dev->rgb_range_cap));
                break;
        }
+       vfree(dev->bitmap_cap);
+       dev->bitmap_cap = NULL;
        vivid_update_quality(dev);
        tpg_reset_source(&dev->tpg, dev->src_rect.width, dev->src_rect.height, dev->field_cap);
        dev->crop_cap = dev->src_rect;