Skip to content

Commit 4e246b5

Browse files
cinema-ONEclaude
andcommitted
Refuse formats the add-on does not implement
The copy loop writes B,G,R and fills the fourth byte only for A8R8G8B8, so that is the only format actually produced. Every other value fell through to that same loop and returned true with output that does not match the request. ADDON_IMG_FMT_A8 was the worst of them: one byte per pixel is asked for and three are written. The previous commit's bounds check now refuses that, but it should not be reached at all. Latent today only because CTexture::LoadIImage() asks for A8R8G8B8. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent adf5664 commit 4e246b5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/MPOPicture.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ bool MPOPicture::Decode(uint8_t* pixels,
160160
unsigned int pitch,
161161
ADDON_IMG_FMT format)
162162
{
163+
// The copy loop below writes B,G,R and only fills the fourth byte for
164+
// A8R8G8B8, so that is the only format implemented here.
165+
if (format != ADDON_IMG_FMT_A8R8G8B8)
166+
{
167+
kodi::Log(ADDON_LOG_ERROR, "%s: Unsupported target format (%d)", __func__,
168+
static_cast<int>(format));
169+
return false;
170+
}
171+
163172
size_t image = 0;
164173
while (image < m_images)
165174
{

0 commit comments

Comments
 (0)