Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for last_cc incorrectly excludes last CC being zero #23

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link


In tsreport.c I believe there's a error in the check as per the diff below. The 
check is for ss->last_cc being set (i.e. there has been a previous CC). last_cc 
is set to -1 to indicate no previous CC, so the check must be for last_cc >= 0 
(or >-1, or != -1). Otherwise a valid previous CC of zero will read as there 
having been no previous CC, potentially missing an error. 

diff --git a/tsreport.c b/tsreport.c
index c7885bc..29d20d1 100644
--- a/tsreport.c
+++ b/tsreport.c
@@ -496,7 +496,7 @@ static int report_buffering_stats(TS_reader_p  tsreader,
       // CC is meant to increment if we have a payload and not if we don't
       // CC may legitimately 'be wrong' if the discontinuity flag is set

-      if (ss->last_cc > 0 && !is_discontinuity)
+      if (ss->last_cc >= 0 && !is_discontinuity)
       {
         // We are allowed 1 dup packet
         if (ss->last_cc == cc)

Original issue reported on code.google.com by piers.sc...@ericsson.com on 29 Jul 2013 at 10:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant