summaryrefslogtreecommitdiff
path: root/libavcodec/sgidec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-08-26 15:17:01 +0000
committerPaul B Mahol <onemda@gmail.com>2013-08-26 19:26:00 +0000
commitf12c27daf7c6faed8b1e5c70e5fa9738737f5567 (patch)
tree1248194a159b5bbd3e3c64323c66d84f3f562eeb /libavcodec/sgidec.c
parentfcaf5fa2ea3871a8f126f40801ab240faad668a5 (diff)
downloadffmpeg-f12c27daf7c6faed8b1e5c70e5fa9738737f5567.tar.gz
sgidec: use bytestream2_get_bufferu()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/sgidec.c')
-rw-r--r--libavcodec/sgidec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 4f7f8ac9f1..3ce5994d9b 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -138,9 +138,10 @@ static int read_uncompressed_sgi(unsigned char* out_buf, SgiState *s)
for (y = s->height - 1; y >= 0; y--) {
out_end = out_buf + (y * s->linesize);
if (s->bytes_per_channel == 1) {
- for (x = s->width; x > 0; x--)
- for (z = 0; z < s->depth; z++)
- *out_end++ = bytestream2_get_byteu(&gp[z]);
+ for (x = s->width; x > 0; x--) {
+ bytestream2_get_bufferu(&gp[z], out_end, s->depth);
+ out_end += s->depth;
+ }
} else {
uint16_t *out16 = (uint16_t *)out_end;
for (x = s->width; x > 0; x--)