rmdemux: Make sure we have enough data available when parsing audio/video packets

Otherwise there will be out-of-bounds reads and potential crashes.

Thanks to Natalie Silvanovich for reporting.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/issues/37

Part-of: <gstreamer/gst-plugins-ugly!75>
29 jobs for !75 with backport-mr-74-into-1.18-rmdemux-fixes in 28 minutes and 41 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Build Docker
passed #7996580
alpine amd64 manifest builder docker

00:00:22

passed #7996579
android docker

00:00:22

passed #7996578
cerbero fedora amd64 docker

00:00:21

passed #7996577
fedora amd64 docker

00:00:23

passed #7996581
gst-indent amd64 docker

00:00:23

 
  Preparation
passed #7996583
gst indent

00:00:07

passed #7996582
manifest

00:00:18

 
  Build
passed #7996592
gstreamer
build cerbero cross-android universal

00:06:55

passed #7996596
gst-ios-14.3
build cerbero cross-ios universal

00:23:35

passed #7996593
gstreamer
build cerbero cross win32

00:07:55

passed #7996594
gstreamer
build cerbero cross win64

00:06:28

passed #7996591
gstreamer
build cerbero fedora x86_64

00:04:55

passed #7996595
gst-macos-11.1
build cerbero macos x86_64

00:12:58

passed #7996587
build clang fedora x86_64

00:04:54

manual #7996590
docker windows 1809 allowed to fail manual
build msys2
passed #7996584
build nodebug fedora x86_64

00:04:41

passed #7996585
build static fedora x86_64

00:03:01

passed #7996586
build static nodebug fedora x86_64

00:04:18

passed #7996588
docker windows 1809
build vs2017 amd64

00:09:56

passed #7996589
docker windows 1809
build vs2017 x86

00:10:07

 
  Test
passed #7996597
gstreamer
check fedora

00:06:15

passed #7996598
gstreamer
integration testsuites fedora 1/4

00:14:14

passed #7996599
gstreamer
integration testsuites fedora 2/4

00:15:40

passed #7996600
gstreamer
integration testsuites fedora 3/4

00:13:14

passed #7996601
gstreamer
integration testsuites fedora 4/4

00:15:03

passed #7996602
gstreamer
valgrind ugly

00:04:04

 
  Integrate
passed #7996603
cross-android universal examples

00:08:49

passed #7996605
gst-ios-14.3
cross-ios universal examples

00:04:19

passed #7996604
documentation

00:21:58