# HG changeset patch # User rbultje # Date 1236636227 0 # Node ID 71f1392ab8d46e2b0abbb59b8d33830294b23b98 # Parent eb3f12a921abe6778d940f38daa4d88142c20202 Prevent (negative) overflow of rm->remaining_len. This evaluation really only has two possible outcomes: either len and rm->remaining_len are the same, in which case we care about the outcome and it is zero, or rm->remaining_len is currently not in use and we don't care about the outcome. In that case, len is positive and rm->remaining_len is zero, which leads to a negative result. This is confusing and could eventually lead to a sign-flip if we skip a lot of packets (unlikely, but still). Therefore, just always set it to zero. diff -r eb3f12a921ab -r 71f1392ab8d4 rmdec.c --- a/rmdec.c Mon Mar 09 22:02:06 2009 +0000 +++ b/rmdec.c Mon Mar 09 22:03:47 2009 +0000 @@ -468,7 +468,7 @@ skip: /* skip packet if unknown number */ url_fskip(pb, len); - rm->remaining_len -= len; + rm->remaining_len = 0; continue; } *stream_index= i;