I think there are 2 smalls bugs involving integer overflow in the LiveMedia
library:

* In "MPEG2IndexFromTransportStream.cpp":
    u_int8_t pcr_frac = (u_int8_t)(256*(pcr-pcr_int));
must be replaced by:
    u_int8_t pcr_frac = (u_int8_t)(255*(pcr-pcr_int));

* In "MPEG2TransportStreamIndexFile.cpp":
  return pcr_int + pcr_frac/256.0f;
must be replaced by:
  return pcr_int + pcr_frac/255.0f;

No - the original code is correct in both cases. Note that "pcr_frac" (in each case) is an 8-bit integer that represents a multiple of 1/256. Therefore, when converting from (or to) a float, we need to multiply (or divide) by 256.
--

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to