~ubuntu-branches/ubuntu/raring/libav/raring-security

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0017-mpegts-fix-Continuity-Counter-error-detection.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-09-28 09:18:34 UTC
  • mfrom: (1.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20110928091834-w415mnuh06h4zpvc
Tags: 4:0.7.1-7ubuntu2
Revert "Convert package to include multiarch support."

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From b772a757dd5e58ce94b56daee0deba78ab2e205e Mon Sep 17 00:00:00 2001
 
2
From: Jindrich Makovicka <makovick@gmail.com>
 
3
Date: Thu, 30 Jun 2011 09:03:15 +0000
 
4
Subject: [PATCH 17/70] mpegts: fix Continuity Counter error detection
 
5
 
 
6
According to MPEG-TS specs, the continuity_counter shall not be
 
7
incremented when the adaptation_field_control of the packet
 
8
equals '00' or '10'.
 
9
 
 
10
Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv>
 
11
Signed-off-by: Anton Khirnov <anton@khirnov.net>
 
12
(cherry picked from commit 8923cfa328e8eb565aebcfe8672b276fd1c19bf7)
 
13
 
 
14
Signed-off-by: Anton Khirnov <anton@khirnov.net>
 
15
---
 
16
 libavformat/mpegts.c |    5 +++--
 
17
 1 files changed, 3 insertions(+), 2 deletions(-)
 
18
 
 
19
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
 
20
index e9b8b35..608cbe7 100644
 
21
--- a/libavformat/mpegts.c
 
22
+++ b/libavformat/mpegts.c
 
23
@@ -1247,7 +1247,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
 
24
 {
 
25
     AVFormatContext *s = ts->stream;
 
26
     MpegTSFilter *tss;
 
27
-    int len, pid, cc, cc_ok, afc, is_start;
 
28
+    int len, pid, cc, expected_cc, cc_ok, afc, is_start;
 
29
     const uint8_t *p, *p_end;
 
30
     int64_t pos;
 
31
 
 
32
@@ -1265,7 +1265,8 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
 
33
 
 
34
     /* continuity check (currently not used) */
 
35
     cc = (packet[3] & 0xf);
 
36
-    cc_ok = (tss->last_cc < 0) || ((((tss->last_cc + 1) & 0x0f) == cc));
 
37
+    expected_cc = (packet[3] & 0x10) ? (tss->last_cc + 1) & 0x0f : tss->last_cc;
 
38
+    cc_ok = (tss->last_cc < 0) || (expected_cc == cc);
 
39
     tss->last_cc = cc;
 
40
 
 
41
     /* skip adaptation field */
 
42
-- 
 
43
1.7.4.1
 
44