summaryrefslogtreecommitdiffstats
path: root/demux/cache.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /demux/cache.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--demux/cache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/demux/cache.c b/demux/cache.c
index 562eab0..6398f61 100644
--- a/demux/cache.c
+++ b/demux/cache.c
@@ -26,6 +26,7 @@
#include "common/msg.h"
#include "common/av_common.h"
#include "demux.h"
+#include "misc/io_utils.h"
#include "options/path.h"
#include "options/m_config.h"
#include "options/m_option.h"
@@ -214,7 +215,7 @@ int64_t demux_cache_write(struct demux_cache *cache, struct demux_packet *dp)
}
assert(!dp->is_cached);
- assert(dp->len >= 0 && dp->len <= INT32_MAX);
+ assert(dp->len <= INT32_MAX);
assert(dp->avpacket->flags >= 0 && dp->avpacket->flags <= INT32_MAX);
assert(dp->avpacket->side_data_elems >= 0 &&
dp->avpacket->side_data_elems <= INT32_MAX);
@@ -260,7 +261,7 @@ int64_t demux_cache_write(struct demux_cache *cache, struct demux_packet *dp)
for (int n = 0; n < dp->avpacket->side_data_elems; n++) {
AVPacketSideData *sd = &dp->avpacket->side_data[n];
- assert(sd->size >= 0 && sd->size <= INT32_MAX);
+ assert(sd->size <= INT32_MAX);
assert(sd->type >= 0 && sd->type <= INT32_MAX);
struct sd_header sd_hd = {
@@ -293,9 +294,6 @@ struct demux_packet *demux_cache_read(struct demux_cache *cache, uint64_t pos)
if (!read_raw(cache, &hd, sizeof(hd)))
return NULL;
- if (hd.data_len >= (size_t)-1)
- return NULL;
-
struct demux_packet *dp = new_demux_packet(hd.data_len);
if (!dp)
goto fail;