[FFmpeg-devel] [PATCH] Pass pointer of correct type for timestamp to ff_rm_parse_packet

Eli Friedman eli.friedman
Mon Mar 30 23:07:29 CEST 2009


Per subject.  The actual bug is in the following code in rdt_parse_packet:
        res = ff_rm_parse_packet (rdt->rmctx, &pb, st,
rdt->rmst[st->index], len, pkt,
                                  &seq, &flags, timestamp);

ff_rm_parse_packet takes a uint64_t* for the timestamp, but it was
getting passed a uint32_t*.  The fix is spread over a few files
because the pointer in question gets passed through a few different
functions.

-Eli
-------------- next part --------------
Index: libavformat/rdt.c
===================================================================
--- libavformat/rdt.c	(revision 18214)
+++ libavformat/rdt.c	(working copy)
@@ -193,7 +193,7 @@
 int
 ff_rdt_parse_header(const uint8_t *buf, int len,
                     int *pset_id, int *pseq_no, int *pstream_id,
-                    int *pis_keyframe, uint32_t *ptimestamp)
+                    int *pis_keyframe, uint64_t *ptimestamp)
 {
     GetBitContext gb;
     int consumed = 0, set_id, seq_no, stream_id, is_keyframe,
@@ -296,7 +296,7 @@
 /**< return 0 on packet, no more left, 1 on packet, 1 on partial packet... */
 static int
 rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
-                  AVPacket *pkt, uint32_t *timestamp,
+                  AVPacket *pkt, uint64_t *timestamp,
                   const uint8_t *buf, int len, int flags)
 {
     int seq = 1, res;
@@ -340,7 +340,7 @@
                     const uint8_t *buf, int len)
 {
     int seq_no, flags = 0, stream_id, set_id, is_keyframe;
-    uint32_t timestamp;
+    uint64_t timestamp;
     int rv= 0;
 
     if (!s->parse_packet)
Index: libavformat/rdt.h
===================================================================
--- libavformat/rdt.h	(revision 18214)
+++ libavformat/rdt.h	(working copy)
@@ -89,7 +89,7 @@
  */
 int ff_rdt_parse_header(const uint8_t *buf, int len,
                         int *set_id, int *seq_no, int *stream_id,
-                        int *is_keyframe, uint32_t *timestamp);
+                        int *is_keyframe, uint64_t *timestamp);
 
 /**
  * Parse RDT-style packet data (header + media data).
Index: libavformat/rtpdec.c
===================================================================
--- libavformat/rtpdec.c	(revision 18214)
+++ libavformat/rtpdec.c	(working copy)
@@ -403,7 +403,7 @@
     unsigned int ssrc, h;
     int payload_type, seq, ret, flags = 0;
     AVStream *st;
-    uint32_t timestamp;
+    uint64_t timestamp;
     int rv= 0;
 
     if (!buf) {
Index: libavformat/rtpdec.h
===================================================================
--- libavformat/rtpdec.h	(revision 18214)
+++ libavformat/rtpdec.h	(working copy)
@@ -112,7 +112,7 @@
                                                 PayloadContext *s,
                                                 AVStream *st,
                                                 AVPacket * pkt,
-                                                uint32_t *timestamp,
+                                                uint64_t *timestamp,
                                                 const uint8_t * buf,
                                                 int len, int flags);
 



More information about the ffmpeg-devel mailing list