mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/dvdsubdec: Don't return value != 0 on init success
Currently, any nonnegative return value from an init function is just treated as success and otherwise ignored; while it is not explicitly forbidden to return something else than 0 (there is no documentation whatsoever), the assumption is that they return zero on success. So change dvdsubdec.c accordingly. Also change dvdsub_parse_extradata() to return zero on success. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
committed by
James Almer
parent
1df63acdc4
commit
9ae42d42e6
@@ -624,10 +624,10 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
|
||||
{
|
||||
DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
|
||||
char *dataorig, *data;
|
||||
int ret = 1;
|
||||
int ret;
|
||||
|
||||
if (!avctx->extradata || !avctx->extradata_size)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
dataorig = data = av_malloc(avctx->extradata_size+1);
|
||||
if (!data)
|
||||
@@ -656,6 +656,7 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
|
||||
data += strspn(data, "\n\r");
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
fail:
|
||||
av_free(dataorig);
|
||||
return ret;
|
||||
@@ -683,7 +684,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
|
||||
av_log(avctx, AV_LOG_DEBUG, "\n");
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold void dvdsub_flush(AVCodecContext *avctx)
|
||||
|
||||
Reference in New Issue
Block a user