summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-01-22 20:17:53 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-01-22 20:17:53 +0100
commit40297a8bdb69844aef780f7e9f2e23700d9d6005 (patch)
tree15e54939513c45b13b6d9d9b942ae21714b5702e /libavcodec
parente65d8509f0657810511b96f2eec43b7cf31434e9 (diff)
downloadffmpeg-40297a8bdb69844aef780f7e9f2e23700d9d6005.tar.gz
Support solid gray frames when decoding Lagarith.
Fixes bug 431.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/lagarith.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 486e326a0f..d5470a58ab 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -535,6 +535,14 @@ static int lag_decode_frame(AVCodecContext *avctx,
switch (frametype) {
case FRAME_SOLID_RGBA:
avctx->pix_fmt = AV_PIX_FMT_RGB32;
+ case FRAME_SOLID_GRAY:
+ if (frametype == FRAME_SOLID_GRAY)
+ if (avctx->bits_per_coded_sample == 24) {
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ } else {
+ avctx->pix_fmt = AV_PIX_FMT_0RGB32;
+ planes = 4;
+ }
if (ff_thread_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@@ -542,11 +550,18 @@ static int lag_decode_frame(AVCodecContext *avctx,
}
dst = p->data[0];
+ if (frametype == FRAME_SOLID_RGBA) {
for (j = 0; j < avctx->height; j++) {
for (i = 0; i < avctx->width; i++)
AV_WN32(dst + i * 4, offset_gu);
dst += p->linesize[0];
}
+ } else {
+ for (j = 0; j < avctx->height; j++) {
+ memset(dst, buf[1], avctx->width * planes);
+ dst += p->linesize[0];
+ }
+ }
break;
case FRAME_ARITH_RGBA:
avctx->pix_fmt = AV_PIX_FMT_RGB32;