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.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1655,11 +1655,11 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, · 1654 unmodified lines | |||
| 1655 | } | 1655 | } |
| 1656 | eos: // end of slice | 1656 | eos: // end of slice |
| 1657 | if (get_bits_left(&s->gb) < 0) { | 1657 | 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)); |
| 1659 | return AVERROR_INVALIDDATA; | 1659 | return AVERROR_INVALIDDATA; |
| 1660 | } | 1660 | } |
| 1661 | *buf += (get_bits_count(&s->gb) - 1) / 8; | 1661 | *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); |
| 1663 | return 0; | 1663 | return 0; |
| 1664 | } | 1664 | } |
| 1665 | 1665 | ||