summaryrefslogtreecommitdiff
path: root/libavcodec/xan.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index b5303eb38b..4152ff4540 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -351,16 +351,8 @@ static void xan_wc3_decode_frame(XanContext *s) {
/* coordinate accounting */
total_pixels -= size;
- while (size) {
- if (x + size >= width) {
- y++;
- size -= (width - x);
- x = 0;
- } else {
- x += size;
- size = 0;
- }
- }
+ y += (x + size) / width;
+ x = (x + size) % width;
}
}