VIDEO: FLIC: Fix decoding of BYTE_RUN/FLI_BRUN chunks
Our decoder currently only supports the standard FLC format which does not rely on the stored packet count (which is part of the FLI format and limited to 255 packets per line). Instead, the image width should be used as criterion when decoding a frame which allows for more than 255 packets per line. See also https://www.compuphase.com/flic.htm
This commit is contained in:
parent
0aed2452c6
commit
ff1b7ff89d
1 changed files with 4 additions and 3 deletions
|
@ -265,9 +265,9 @@ void FlicDecoder::FlicVideoTrack::copyFrame(uint8 *data) {
|
|||
|
||||
void FlicDecoder::FlicVideoTrack::decodeByteRun(uint8 *data) {
|
||||
byte *ptr = (byte *)_surface->getPixels();
|
||||
while ((int32)(ptr - (byte *)_surface->getPixels()) < (getWidth() * getHeight())) {
|
||||
int chunks = *data++;
|
||||
while (chunks--) {
|
||||
for (int i = 0; i < getHeight(); ++i) {
|
||||
data++;
|
||||
for (int j = 0; j < getWidth();) {
|
||||
int count = (int8)*data++;
|
||||
if (count > 0) {
|
||||
memset(ptr, *data++, count);
|
||||
|
@ -277,6 +277,7 @@ void FlicDecoder::FlicVideoTrack::decodeByteRun(uint8 *data) {
|
|||
data += count;
|
||||
}
|
||||
ptr += count;
|
||||
j += count;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue