aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/evc_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-06-18 20:29:16 -0300
committerJames Almer <jamrial@gmail.com>2023-06-19 16:00:55 -0300
commit921596e677e7b3617f70a21d7188f8bc0f314328 (patch)
treef7d68d7dc1adad754af5eedb143e30bcc433be97 /libavcodec/evc_parser.c
parent5cb9ef93000048afe29ce1c67f151ad3fffcd83a (diff)
downloadffmpeg-921596e677e7b3617f70a21d7188f8bc0f314328.tar.gz
avcodec/evc_ps: make ff_evc_parse_{sps,pps} return an error code
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/evc_parser.c')
-rw-r--r--libavcodec/evc_parser.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libavcodec/evc_parser.c b/libavcodec/evc_parser.c
index 710fabccb2..5c8fcc5970 100644
--- a/libavcodec/evc_parser.c
+++ b/libavcodec/evc_parser.c
@@ -63,6 +63,7 @@ static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx,
{
EVCParserContext *ctx = s->priv_data;
int nalu_type, tid;
+ int ret;
if (buf_size <= 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size: (%d)\n", buf_size);
@@ -87,29 +88,26 @@ static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx,
buf_size -= EVC_NALU_HEADER_SIZE;
switch (nalu_type) {
- case EVC_SPS_NUT: {
- EVCParserSPS *sps = ff_evc_parse_sps(&ctx->ps, buf, buf_size);
- if (!sps) {
+ case EVC_SPS_NUT:
+ ret = ff_evc_parse_sps(&ctx->ps, buf, buf_size);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "SPS parsing error\n");
- return AVERROR_INVALIDDATA;
+ return ret;
}
break;
- }
- case EVC_PPS_NUT: {
- EVCParserPPS *pps = ff_evc_parse_pps(&ctx->ps, buf, buf_size);
- if (!pps) {
+ case EVC_PPS_NUT:
+ ret = ff_evc_parse_pps(&ctx->ps, buf, buf_size);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "PPS parsing error\n");
- return AVERROR_INVALIDDATA;
+ return ret;
}
break;
- }
case EVC_IDR_NUT: // Coded slice of a IDR or non-IDR picture
case EVC_NOIDR_NUT: {
const EVCParserPPS *pps;
const EVCParserSPS *sps;
EVCParserSliceHeader sh;
int bit_depth;
- int ret;
ret = ff_evc_parse_slice_header(&sh, &ctx->ps, nalu_type, buf, buf_size);
if (ret < 0) {