Commit b49d94e4 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Support decoding of targa files with 32bit palette.

parent a0276299
...@@ -181,6 +181,7 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -181,6 +181,7 @@ static int decode_frame(AVCodecContext *avctx,
return -1; return -1;
} }
switch (csize) { switch (csize) {
case 32: pal_sample_size = 4; break;
case 24: pal_sample_size = 3; break; case 24: pal_sample_size = 3; break;
case 16: case 16:
case 15: pal_sample_size = 2; break; case 15: pal_sample_size = 2; break;
...@@ -201,6 +202,10 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -201,6 +202,10 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
switch (pal_sample_size) { switch (pal_sample_size) {
case 4:
for (t = 0; t < colors; t++)
*pal++ = bytestream2_get_le32u(&s->gb);
break;
case 3: case 3:
/* RGB24 */ /* RGB24 */
for (t = 0; t < colors; t++) for (t = 0; t < colors; t++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment