diff options
-rw-r--r-- | apps/buffering.c | 3 | ||||
-rw-r--r-- | apps/playback.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index 531413bcb4..2d7ca22368 100644 --- a/apps/buffering.c +++ b/apps/buffering.c | |||
@@ -880,6 +880,9 @@ int bufopen(const char *file, size_t offset, enum data_type type) | |||
880 | size_t size = filesize(fd); | 880 | size_t size = filesize(fd); |
881 | bool can_wrap = type==TYPE_PACKET_AUDIO || type==TYPE_CODEC; | 881 | bool can_wrap = type==TYPE_PACKET_AUDIO || type==TYPE_CODEC; |
882 | 882 | ||
883 | if (offset > size) | ||
884 | offset = 0; | ||
885 | |||
883 | struct memory_handle *h = add_handle(size-offset, can_wrap, false); | 886 | struct memory_handle *h = add_handle(size-offset, can_wrap, false); |
884 | if (!h) | 887 | if (!h) |
885 | { | 888 | { |
diff --git a/apps/playback.c b/apps/playback.c index 1e5cd626de..ed581cd36a 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -1683,6 +1683,9 @@ static bool audio_load_track(int offset, bool start_play) | |||
1683 | 1683 | ||
1684 | tracks[track_widx].filesize = filesize(fd); | 1684 | tracks[track_widx].filesize = filesize(fd); |
1685 | 1685 | ||
1686 | if ((unsigned)offset > tracks[track_widx].filesize) | ||
1687 | offset = 0; | ||
1688 | |||
1686 | /* Set default values */ | 1689 | /* Set default values */ |
1687 | if (start_play) | 1690 | if (start_play) |
1688 | { | 1691 | { |