gstreamer/subprojects/gst-plugins-bad/sys
Marek Vasut 3cbf09d0c9 mpeg2decoder: Fix multiplication wraparound
The GstMpeg2Picture system_frame_number is guint32, constant 1000 is guint32,
GstV4l2CodecMpeg2Dec *_ref_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 MPEG2 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>
2023-12-20 18:47:39 +00:00
..
aja aja: Move clang-format configuration from the top-level to the plugin subdirectory 2023-10-27 11:44:36 +00:00
amfcodec d3d11: Rework memory allocation params signalling 2023-11-27 15:14:09 +00:00
androidmedia androidmedia/enc: handle codec-data before popping GstVideoCodecFrames 2023-09-15 17:47:17 +03:00
applemedia vtdec: Fix deadlock when attempting to negotiate 2023-10-20 13:50:16 +02:00
asio meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
bluez avdtputil: Use int instead of int range for fixed bitpool values 2023-05-17 03:13:54 +00:00
d3d11 d3d11: fix building with address sanitizer 2023-12-07 21:36:20 +00:00
d3d12 d3d12decoder: Implement threaded decoding 2023-12-15 22:56:33 +09:00
d3dvideosink d3dvideosink: Fix navigation event leak 2023-06-15 05:09:46 +00:00
decklink decklink: Fix typo in element documentation 2023-11-09 07:53:12 +00:00
directshow sys: avoid double definition of symbol MEDIASUBTYPE_I420 2023-03-23 00:56:04 +00:00
directsound meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
dvb doc: Fix newline char between authors 2023-05-20 05:48:23 +00:00
dwrite d3d11: Rework memory allocation params signalling 2023-11-27 15:14:09 +00:00
fbdev meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
ipcpipeline meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
kms kmssink: Add TIDSS auto-detection 2023-10-12 18:25:50 +00:00
magicleap meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
mediafoundation mediafoundation: Fix build with GST_DISABLE_GST_DEBUG 2023-11-03 13:31:03 +00:00
msdk va: no need to provide a buffer size for VA pool 2023-12-14 12:50:32 +00:00
nvcodec cudaipcsink: Fix deadlock on stop 2023-12-06 16:09:27 +00:00
opensles meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
qsv va: no need to provide a buffer size for VA pool 2023-12-14 12:50:32 +00:00
shm shm: drop use of GSlice allocator 2023-02-03 17:48:10 +00:00
tinyalsa meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
uvcgadget uvcsink: use the pad's current caps to update caps_changed 2023-10-06 15:55:23 +00:00
uvch264 meson: Add a wrap file for libgudev 2023-04-19 22:47:19 +00:00
v4l2codecs mpeg2decoder: Fix multiplication wraparound 2023-12-20 18:47:39 +00:00
va vacompositor: consider the DMA kind input for sink pad 2023-12-16 10:56:09 +00:00
wasapi wasapi: Don't redefine GUIDs when building under newer MinGW 2023-08-09 14:47:57 +00:00
wasapi2 wasapi2device: Ignore activation failed device 2023-11-06 12:28:50 +00:00
wic bad: Update indent 2023-02-28 10:12:31 +00:00
win32ipc win32ipc: Fix pipe handle leak 2023-08-23 18:33:04 +09:00
winks doc: Fix newline char between authors 2023-05-20 05:48:23 +00:00
winscreencap winscreencap: Warn for deprecated plugin use 2022-12-08 17:48:11 +00:00
meson.build aja: Integrate AJA plugin into the build system 2023-10-26 09:36:09 +03:00