#if CONFIG_CBS_H265
&ff_cbs_type_h265,
#endif
+#if CONFIG_CBS_MPEG2
+ &ff_cbs_type_mpeg2,
+#endif
};
int ff_cbs_init(CodedBitstreamContext *ctx,
av_assert0(width <= 32);
+ if (bitstream_bits_left(bc) < width) {
+ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid value at "
+ "%s: bitstream ended.\n", name);
+ return AVERROR_INVALIDDATA;
+ }
+
if (ctx->trace_enable)
position = bitstream_tell(bc);