summaryrefslogtreecommitdiff
path: root/libavcodec/flashsv2enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-12 12:03:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-12 12:06:37 +0200
commit40d8c89cb67da27e084060545c9fc2648cdbe17a (patch)
tree24d9f1f7b9b8de5a336c27535f333cbb1b7c2bc4 /libavcodec/flashsv2enc.c
parentd04956344d38ddd77ec61042ce57cd9021491c83 (diff)
downloadffmpeg-40d8c89cb67da27e084060545c9fc2648cdbe17a.tar.gz
flashsvenc: fix image sizes below 192x192
Fixes half of Ticket1105 Found-by: ami_stuff Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flashsv2enc.c')
-rw-r--r--libavcodec/flashsv2enc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c
index fd7f5c7276..fbf0c9c1be 100644
--- a/libavcodec/flashsv2enc.c
+++ b/libavcodec/flashsv2enc.c
@@ -205,6 +205,11 @@ static av_cold int flashsv2_encode_init(AVCodecContext * avctx)
s->block_width = (s->image_width / 12) & ~15;
s->block_height = (s->image_height / 12) & ~15;
+ if(!s->block_width)
+ s->block_width = 1;
+ if(!s->block_height)
+ s->block_height = 1;
+
s->rows = (s->image_height + s->block_height - 1) / s->block_height;
s->cols = (s->image_width + s->block_width - 1) / s->block_width;