[FFmpeg-devel] lavc/libdavs2: use assert instead of wrong return value

Submitted by hwren on Nov. 1, 2018, 4:20 a.m.

Details

Message ID 1541046018-5611-1-git-send-email-hwrenx@126.com
State New
Headers show

Commit Message

hwren Nov. 1, 2018, 4:20 a.m.
Signed-off-by: hwren <hwrenx@126.com>
---
 libavcodec/libdavs2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carl Eugen Hoyos Nov. 1, 2018, 4:53 p.m.
2018-11-01 5:20 GMT+01:00, hwren <hwrenx@126.com>:
> Signed-off-by: hwren <hwrenx@126.com>
> ---
>  libavcodec/libdavs2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> index 4dbce73..acdfaca 100644
> --- a/libavcodec/libdavs2.c
> +++ b/libavcodec/libdavs2.c
> @@ -93,7 +93,7 @@ static int davs2_dump_frames(AVCodecContext *avctx,
> davs2_picture_t *pic,
>              break;
>          default:
>              av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame
> type\n");
> -            return AVERROR_EXTERNAL;
> +            assert(0);

Please do not assert on return values of an external library.

Carl Eugen

Patch hide | download patch | download mbox

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 4dbce73..acdfaca 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -93,7 +93,7 @@  static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
             break;
         default:
             av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame type\n");
-            return AVERROR_EXTERNAL;
+            assert(0);
     }
 
     for (plane = 0; plane < 3; ++plane) {