summaryrefslogtreecommitdiffstats
path: root/libavcodec/flicvideo.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-03-26 14:56:55 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-03-26 14:56:55 +0100
commitde1a0d43595b98c1093c9fc39de0e96fba8e9a06 (patch)
treee1b0f590dde2487ce00fb7578380bad00393de3f /libavcodec/flicvideo.c
parentc06bdc60c90d6cc978c783e6d937eeb77a6801f0 (diff)
downloadffmpeg-streaming-de1a0d43595b98c1093c9fc39de0e96fba8e9a06.zip
ffmpeg-streaming-de1a0d43595b98c1093c9fc39de0e96fba8e9a06.tar.gz
lavc/flicvideo: Implement padding in COPY chunks.
Reviewed-by: Reimar
Diffstat (limited to 'libavcodec/flicvideo.c')
-rw-r--r--libavcodec/flicvideo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 3e0573a..7535a40 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -423,7 +423,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
case FLI_COPY:
/* copy the chunk (uncompressed frame) */
- if (chunk_size - 6 != s->avctx->width * s->avctx->height) {
+ if (chunk_size - 6 != FFALIGN(s->avctx->width, 4) * s->avctx->height) {
av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
"has incorrect size, skipping chunk\n", chunk_size - 6);
bytestream2_skip(&g2, chunk_size - 6);
@@ -432,6 +432,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
y_ptr += s->frame->linesize[0]) {
bytestream2_get_buffer(&g2, &pixels[y_ptr],
s->avctx->width);
+ if (s->avctx->width & 3)
+ bytestream2_skip(&g2, 4 - (s->avctx->width & 3));
}
}
break;
@@ -711,7 +713,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
case FLI_COPY:
case FLI_DTA_COPY:
/* copy the chunk (uncompressed frame) */
- if (chunk_size - 6 > (unsigned int)(s->avctx->width * s->avctx->height)*2) {
+ if (chunk_size - 6 > (unsigned int)(FFALIGN(s->avctx->width, 2) * s->avctx->height)*2) {
av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
"bigger than image, skipping chunk\n", chunk_size - 6);
bytestream2_skip(&g2, chunk_size - 6);
@@ -727,6 +729,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
pixel_ptr += 2;
pixel_countdown--;
}
+ if (s->avctx->width & 1)
+ bytestream2_skip(&g2, 2);
}
}
break;
OpenPOWER on IntegriCloud