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

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mpeg12dec.c+2−2
@@ -1655,11 +1655,11 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, · 1654 unmodified lines
1655 }1655 }
1656eos: // end of slice1656eos: // 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

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