diff --git a/image/codecs/cinepak.cpp b/image/codecs/cinepak.cpp
index 53d68617451..7b97691c275 100644
a
|
b
|
const Graphics::Surface *CinepakDecoder::decodeFrame(Common::SeekableReadStream
|
424 | 424 | } |
425 | 425 | |
426 | 426 | if (!_curFrame.surface) { |
| 427 | _curFrame.surface = new Graphics::Surface(); |
| 428 | _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat); |
| 429 | } else if (_ditherPalette && _pixelFormat.bytesPerPixel != _curFrame.surface->format.bytesPerPixel) { |
| 430 | _curFrame.surface->free(); |
| 431 | delete _curFrame.surface; |
| 432 | |
427 | 433 | _curFrame.surface = new Graphics::Surface(); |
428 | 434 | _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat); |
429 | 435 | } |