Re: [FFmpeg-devel] [PATCH 2/3] lavf/avidec: don't treat I/O errors as EOF

2018-11-29 Thread Michael Niedermayer
On Wed, Nov 28, 2018 at 01:19:58AM -0600, Rodger Combs wrote:
> ---
>  libavformat/avidec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index 3f074795a7..1d131b299c 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -1383,8 +1383,8 @@ static int ni_prepare_read(AVFormatContext *s)
>  if (i >= 0) {
>  int64_t pos = best_st->index_entries[i].pos;
>  pos += best_ast->packet_size - best_ast->remaining;
> -if (avio_seek(s->pb, pos + 8, SEEK_SET) < 0)
> -  return AVERROR_EOF;
> +if ((pos = avio_seek(s->pb, pos + 8, SEEK_SET)) < 0)
> +  return pos;

should be ok if tested with a case that triggers this codepath

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3] lavf/avidec: don't treat I/O errors as EOF

2018-11-27 Thread Rodger Combs
---
 libavformat/avidec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3f074795a7..1d131b299c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1383,8 +1383,8 @@ static int ni_prepare_read(AVFormatContext *s)
 if (i >= 0) {
 int64_t pos = best_st->index_entries[i].pos;
 pos += best_ast->packet_size - best_ast->remaining;
-if (avio_seek(s->pb, pos + 8, SEEK_SET) < 0)
-  return AVERROR_EOF;
+if ((pos = avio_seek(s->pb, pos + 8, SEEK_SET)) < 0)
+  return pos;
 
 av_assert0(best_ast->remaining <= best_ast->packet_size);
 
-- 
2.19.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel