History

avcodec/mpeg12dec: Use proper logcontext

When used with the "mpegvideo" or "mpeg1video" decoder (which do not have a private class) this would lead to the log callback receiving a non-NULL object with a NULL AVClass pointer. The default log callback handles this gracefully, yet it is probably an API violation.

Andreas Rheinhardt committed 1 year ago

Commit 883120a1 parent 9e277301 file · +2 −2Browse files

Unified · Split

libavcodec/mpeg12dec.c+2−2
@@ -1655,11 +1655,11 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, · 1654 unmodified lines
16551655 }
16561656 eos: // end of slice
16571657 if (get_bits_left(&s->gb) < 0) {
1658− av_log(s, AV_LOG_ERROR, "overread %d\n", -get_bits_left(&s->gb));
1658+ av_log(s->avctx, AV_LOG_ERROR, "overread %d\n", -get_bits_left(&s->gb));
16591659 return AVERROR_INVALIDDATA;
16601660 }
16611661 *buf += (get_bits_count(&s->gb) - 1) / 8;
1662− ff_dlog(s, "Slice start:%d %d end:%d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
1662+ ff_dlog(s->avctx, "Slice start:%d %d end:%d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
16631663 return 0;
16641664 }
16651665

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t