Commit f352ed33 authored by Laurent Aimar's avatar Laurent Aimar Committed by Jean-Baptiste Kempf

Hide errors with multi-part rar when the end of archive block is missing.

(cherry picked from commit 8de46adc1189fe3a3ad7c127896ec026d9da3d62)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent cb1c93f7
...@@ -330,7 +330,7 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file) ...@@ -330,7 +330,7 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
} }
/* */ /* */
int has_next = 1; int has_next = -1;
for (;;) { for (;;) {
rar_block_t bk; rar_block_t bk;
int ret; int ret;
...@@ -353,8 +353,8 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file) ...@@ -353,8 +353,8 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
if (ret) if (ret)
break; break;
} }
if (has_next < 0) if (has_next < 0 && *count > 0 && !(*file)[*count -1]->is_complete)
has_next = *count > 0 && !(*file)[*count -1]->is_complete; has_next = 1;
if (vol != s) if (vol != s)
stream_Delete(vol); stream_Delete(vol);
...@@ -391,7 +391,12 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file) ...@@ -391,7 +391,12 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
if (!volume_mrl) if (!volume_mrl)
return VLC_SUCCESS; return VLC_SUCCESS;
const int s_flags = s->i_flags;
if (has_next < 0)
s->i_flags |= OBJECT_FLAGS_NOINTERACT;
vol = stream_UrlNew(s, volume_mrl); vol = stream_UrlNew(s, volume_mrl);
s->i_flags = s_flags;
if (!vol) { if (!vol) {
free(volume_mrl); free(volume_mrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment