提交 38a2d9ae 编写于 作者: C Clément Bœsch

lavc/h264_parser: replace AVCodecContext with logging ctx in scan_mmco_reset()

上级 4fdea02d
...@@ -149,7 +149,7 @@ found: ...@@ -149,7 +149,7 @@ found:
} }
static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
AVCodecContext *avctx) void *logctx)
{ {
H264PredWeightTable pwt; H264PredWeightTable pwt;
int slice_type_nos = s->pict_type & 3; int slice_type_nos = s->pict_type & 3;
...@@ -164,7 +164,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, ...@@ -164,7 +164,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
get_bits1(gb); // direct_spatial_mv_pred get_bits1(gb); // direct_spatial_mv_pred
if (ff_h264_parse_ref_count(&list_count, ref_count, gb, p->ps.pps, if (ff_h264_parse_ref_count(&list_count, ref_count, gb, p->ps.pps,
slice_type_nos, p->picture_structure, avctx) < 0) slice_type_nos, p->picture_structure, logctx) < 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (slice_type_nos != AV_PICTURE_TYPE_I) { if (slice_type_nos != AV_PICTURE_TYPE_I) {
...@@ -178,7 +178,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, ...@@ -178,7 +178,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
if (reordering_of_pic_nums_idc < 3) if (reordering_of_pic_nums_idc < 3)
get_ue_golomb_long(gb); get_ue_golomb_long(gb);
else if (reordering_of_pic_nums_idc > 3) { else if (reordering_of_pic_nums_idc > 3) {
av_log(avctx, AV_LOG_ERROR, av_log(logctx, AV_LOG_ERROR,
"illegal reordering_of_pic_nums_idc %d\n", "illegal reordering_of_pic_nums_idc %d\n",
reordering_of_pic_nums_idc); reordering_of_pic_nums_idc);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
...@@ -186,7 +186,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, ...@@ -186,7 +186,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
break; break;
if (index >= ref_count[list]) { if (index >= ref_count[list]) {
av_log(avctx, AV_LOG_ERROR, av_log(logctx, AV_LOG_ERROR,
"reference count %d overflow\n", index); "reference count %d overflow\n", index);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
...@@ -198,14 +198,14 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb, ...@@ -198,14 +198,14 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
if ((p->ps.pps->weighted_pred && slice_type_nos == AV_PICTURE_TYPE_P) || if ((p->ps.pps->weighted_pred && slice_type_nos == AV_PICTURE_TYPE_P) ||
(p->ps.pps->weighted_bipred_idc == 1 && slice_type_nos == AV_PICTURE_TYPE_B)) (p->ps.pps->weighted_bipred_idc == 1 && slice_type_nos == AV_PICTURE_TYPE_B))
ff_h264_pred_weight_table(gb, p->ps.sps, ref_count, slice_type_nos, ff_h264_pred_weight_table(gb, p->ps.sps, ref_count, slice_type_nos,
&pwt, avctx); &pwt, logctx);
if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
int i; int i;
for (i = 0; i < MAX_MMCO_COUNT; i++) { for (i = 0; i < MAX_MMCO_COUNT; i++) {
MMCOOpcode opcode = get_ue_golomb_31(gb); MMCOOpcode opcode = get_ue_golomb_31(gb);
if (opcode > (unsigned) MMCO_LONG) { if (opcode > (unsigned) MMCO_LONG) {
av_log(avctx, AV_LOG_ERROR, av_log(logctx, AV_LOG_ERROR,
"illegal memory management control operation %d\n", "illegal memory management control operation %d\n",
opcode); opcode);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册