Re: [FFmpeg-devel] [PATCH 3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

2017-10-27 Thread Jan Ekstrom
On Fri, Oct 27, 2017 at 9:46 PM, Nicolas George  wrote:
> Signed-off-by: Nicolas George 
> ---

LGTM

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


[FFmpeg-devel] [PATCH 3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

2017-10-27 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavformat/aviobuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index bfd40f5097..3b4c8439d6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -529,7 +529,7 @@ static int read_packet_wrapper(AVIOContext *s, uint8_t 
*buf, int size)
 int ret;
 
 if (!s->read_packet)
-return AVERROR_EOF;
+return AVERROR(EINVAL);
 ret = s->read_packet(s->opaque, buf, size);
 #if FF_API_OLD_AVIO_EOF_0
 if (!ret && !s->max_packet_size) {
-- 
2.14.2

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


Re: [FFmpeg-devel] [PATCH 3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

2017-10-25 Thread Nicolas George
Le quartidi 4 brumaire, an CCXXVI, Hendrik Leppkes a écrit :
> I think you meant to change the other ret assignment?

You are entirely right. Locally swapped. Thanks for noticing.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH 3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

2017-10-25 Thread Hendrik Leppkes
On Wed, Oct 25, 2017 at 10:22 AM, Nicolas George  wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavformat/aviobuf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> Not related to the issue, but seems more correct.
>
>
> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> index bb5bcf7a14..dfe8437b18 100644
> --- a/libavformat/aviobuf.c
> +++ b/libavformat/aviobuf.c
> @@ -534,7 +534,7 @@ static int read_packet_wrapper(AVIOContext *s, uint8_t 
> *buf, int size)
>  #if FF_API_OLD_AVIO_EOF_0
>  if (!ret && !s->max_packet_size) {
>  av_log(s, AV_LOG_WARNING, "Invalid return value 0 for stream 
> protocol\n");
> -ret = AVERROR_EOF;
> +ret = AVERROR(EINVAL);
>  }
>  #else
>  av_assert2(ret || s->max_packet_size);
> --

I think you meant to change the other ret assignment?

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


[FFmpeg-devel] [PATCH 3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

2017-10-25 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavformat/aviobuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Not related to the issue, but seems more correct.


diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index bb5bcf7a14..dfe8437b18 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -534,7 +534,7 @@ static int read_packet_wrapper(AVIOContext *s, uint8_t 
*buf, int size)
 #if FF_API_OLD_AVIO_EOF_0
 if (!ret && !s->max_packet_size) {
 av_log(s, AV_LOG_WARNING, "Invalid return value 0 for stream 
protocol\n");
-ret = AVERROR_EOF;
+ret = AVERROR(EINVAL);
 }
 #else
 av_assert2(ret || s->max_packet_size);
-- 
2.14.2

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