aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pictordec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-12-02 19:57:34 +1100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-02 14:41:10 +0100
commit1fd69243201741e1ad9026cdfd72194d25caceef (patch)
tree8309f7f96839e572ddad934b5be9b0b41406b0a5 /libavcodec/pictordec.c
parentbba8975a9c2fdfac4dcda5babb290eab869739e8 (diff)
downloadandroid_external_ffmpeg-1fd69243201741e1ad9026cdfd72194d25caceef.tar.gz
android_external_ffmpeg-1fd69243201741e1ad9026cdfd72194d25caceef.tar.bz2
android_external_ffmpeg-1fd69243201741e1ad9026cdfd72194d25caceef.zip
pictordec: support uncompressed images
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pictordec.c')
-rw-r--r--libavcodec/pictordec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index ca3e791f9a..ed372bc996 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -198,10 +198,10 @@ static int decode_frame(AVCodecContext *avctx,
buf += esize;
- x = 0;
y = s->height - 1;
- plane = 0;
if (bytestream_get_le16(&buf)) {
+ x = 0;
+ plane = 0;
while (y >= 0 && buf_end - buf >= 6) {
const uint8_t *buf_pend = buf + FFMIN(AV_RL16(buf), buf_end - buf);
//ignore uncompressed block size reported at buf[2]
@@ -228,8 +228,11 @@ static int decode_frame(AVCodecContext *avctx,
}
}
} else {
- av_log_ask_for_sample(avctx, "uncompressed image\n");
- return buf_size;
+ while (y >= 0 && buf < buf_end) {
+ memcpy(s->frame.data[0] + y * s->frame.linesize[0], buf, FFMIN(avctx->width, buf_end - buf));
+ buf += avctx->width;
+ y--;
+ }
}
*data_size = sizeof(AVFrame);