OSDN Git Service

hevc_ps: make sure failing to decode an SPS always returns an error
authorAnton Khirnov <anton@khirnov.net>
Mon, 13 Jul 2015 05:49:03 +0000 (07:49 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 13 Jul 2015 05:49:03 +0000 (07:49 +0200)
Some of the goto err clauses do not set the error code. It seems better
to fall back on INVALIDDATA instead of adding it everywhere explicitly.

libavcodec/hevc_ps.c

index 6102905..a1eaf6e 100644 (file)
@@ -965,7 +965,7 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
     return 0;
 
 err:
-    return ret;
+    return ret < 0 ? ret : AVERROR_INVALIDDATA;
 }
 
 int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,