diff mbox series

[FFmpeg-devel] avformat/mvdec: propagate the errors returned by parse_audio_var()

Message ID 20210916193459.1216-1-jamrial@gmail.com
State Accepted
Commit 229e949c8e62b01a6c2e0a5fa5444fbd05ab22ef
Headers show
Series [FFmpeg-devel] avformat/mvdec: propagate the errors returned by parse_audio_var() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

James Almer Sept. 16, 2021, 7:34 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Rheinhardt Sept. 16, 2021, 7:39 p.m. UTC | #1
James Almer:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/mvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
> index 7573087c7c..0b4aa1f18f 100644
> --- a/libavformat/mvdec.c
> +++ b/libavformat/mvdec.c
> @@ -387,7 +387,7 @@ static int mv_read_header(AVFormatContext *avctx)
>              if (!ast)
>                  return AVERROR(ENOMEM);
>              ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
> -            if ((read_table(avctx, ast, parse_audio_var)) < 0)
> +            if ((ret = read_table(avctx, ast, parse_audio_var)) < 0)
>                  return ret;
>              if (mv->acompression == 100 &&
>                  mv->aformat == AUDIO_FORMAT_SIGNED &&
> 

The title is misleading: it should be something like "Don't signal
success upon error". Just reading your title would indicate that we are
just making error codes up instead of forwarding them.

- Andreas
James Almer Sept. 16, 2021, 7:46 p.m. UTC | #2
On 9/16/2021 4:39 PM, Andreas Rheinhardt wrote:
> James Almer:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavformat/mvdec.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
>> index 7573087c7c..0b4aa1f18f 100644
>> --- a/libavformat/mvdec.c
>> +++ b/libavformat/mvdec.c
>> @@ -387,7 +387,7 @@ static int mv_read_header(AVFormatContext *avctx)
>>               if (!ast)
>>                   return AVERROR(ENOMEM);
>>               ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
>> -            if ((read_table(avctx, ast, parse_audio_var)) < 0)
>> +            if ((ret = read_table(avctx, ast, parse_audio_var)) < 0)
>>                   return ret;
>>               if (mv->acompression == 100 &&
>>                   mv->aformat == AUDIO_FORMAT_SIGNED &&
>>
> 
> The title is misleading: it should be something like "Don't signal
> success upon error". Just reading your title would indicate that we are
> just making error codes up instead of forwarding them.

I don't really think it's misleading, but sure, I'll use your suggestion.

> 
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 7573087c7c..0b4aa1f18f 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -387,7 +387,7 @@  static int mv_read_header(AVFormatContext *avctx)
             if (!ast)
                 return AVERROR(ENOMEM);
             ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
-            if ((read_table(avctx, ast, parse_audio_var)) < 0)
+            if ((ret = read_table(avctx, ast, parse_audio_var)) < 0)
                 return ret;
             if (mv->acompression == 100 &&
                 mv->aformat == AUDIO_FORMAT_SIGNED &&