]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cbs_h264: fix storage type for time_offset in Pic Timing SEI
authorJames Almer <jamrial@gmail.com>
Mon, 15 Apr 2019 20:50:01 +0000 (17:50 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 16 Apr 2019 23:32:43 +0000 (20:32 -0300)
The spec defines it as a signed value.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/cbs_h264.h
libavcodec/cbs_h264_syntax_template.c

index 92277e475061798cb561ca6ac0cd4403b34e0c18..b5eee7c370217975a58b2ba62642ecd63c33ac3f 100644 (file)
@@ -253,7 +253,7 @@ typedef struct H264RawSEIPicTimestamp {
     uint8_t minutes_value;
     uint8_t hours_flag;
     uint8_t hours_value;
-    uint32_t time_offset;
+    int32_t time_offset;
 } H264RawSEIPicTimestamp;
 
 typedef struct H264RawSEIPicTiming {
index 4da4c5da673603e6fb18cb32ff8575b048bb72a1..07b4cddb5e6e554ea2d22f2babb32952742475ce 100644 (file)
@@ -592,8 +592,9 @@ static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
         time_offset_length = 24;
 
     if (time_offset_length > 0)
-        u(time_offset_length, time_offset,
-          0, MAX_UINT_BITS(time_offset_length));
+        i(time_offset_length, time_offset,
+          MIN_INT_BITS(time_offset_length),
+          MAX_INT_BITS(time_offset_length));
     else
         infer(time_offset, 0);