mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
15c9a6caa9
The GstVp8Picture system_frame_number is guint32, constant 1000 is guint32, GstV4l2CodecVp8Dec v4l2_vp8_frame.*_frame_ts multiplication result is u64 . ``` u64 result = (u32)((u32)system_frame_number * (u32)1000); ``` behaves the same as ``` u64 result = (u32)(((u32)system_frame_number * (u32)1000) & 0xffffffff); ``` so in case `system_frame_number > 4294967295 / 1000`, the `result` will wrap around. Since the `result` is really used as a cookie used to look up V4L2 buffers related to the currently decoded frame, this wraparound leads to visible corruption during VP8 decoding. At 30 FPS this occurs after cca. 40 hours of playback . Fix this by changing the 1000 from u32 to u64, i.e.: ``` u64 result = (u64)((u32)system_frame_number * (u64)1000ULL); ``` this way, the wraparound is prevented and the correct cookie is used. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5791> |
||
---|---|---|
.. | ||
linux | ||
gstv4l2codecallocator.c | ||
gstv4l2codecallocator.h | ||
gstv4l2codecalphadecodebin.c | ||
gstv4l2codecalphadecodebin.h | ||
gstv4l2codecav1dec.c | ||
gstv4l2codecav1dec.h | ||
gstv4l2codecdevice.c | ||
gstv4l2codecdevice.h | ||
gstv4l2codech264dec.c | ||
gstv4l2codech264dec.h | ||
gstv4l2codech265dec.c | ||
gstv4l2codech265dec.h | ||
gstv4l2codecmpeg2dec.c | ||
gstv4l2codecmpeg2dec.h | ||
gstv4l2codecpool.c | ||
gstv4l2codecpool.h | ||
gstv4l2codecvp8dec.c | ||
gstv4l2codecvp8dec.h | ||
gstv4l2codecvp9dec.c | ||
gstv4l2codecvp9dec.h | ||
gstv4l2decoder.c | ||
gstv4l2decoder.h | ||
gstv4l2format.c | ||
gstv4l2format.h | ||
meson.build | ||
plugin.c |