[FFmpeg-cvslog] r17919 - trunk/libavformat/rmdec.c
rbultje
subversion
Mon Mar 9 23:03:48 CET 2009
Author: rbultje
Date: Mon Mar 9 23:03:47 2009
New Revision: 17919
Log:
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.
Modified:
trunk/libavformat/rmdec.c
Modified: trunk/libavformat/rmdec.c
==============================================================================
--- trunk/libavformat/rmdec.c Mon Mar 9 23:02:06 2009 (r17918)
+++ trunk/libavformat/rmdec.c Mon Mar 9 23:03:47 2009 (r17919)
@@ -468,7 +468,7 @@ static int sync(AVFormatContext *s, int6
skip:
/* skip packet if unknown number */
url_fskip(pb, len);
- rm->remaining_len -= len;
+ rm->remaining_len = 0;
continue;
}
*stream_index= i;
More information about the ffmpeg-cvslog
mailing list