On Tue, May 16, 2017 at 03:13:36PM +0300, Ivan Shmakov wrote: > --- > libavcodec/h264_ps.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c > index 7858361..09e2290 100644 > --- a/libavcodec/h264_ps.c > +++ b/libavcodec/h264_ps.c > @@ -136,6 +136,7 @@ static inline int decode_vui_parameters(GetBitContext > *gb, AVCodecContext *avctx > { > int aspect_ratio_info_present_flag; > unsigned int aspect_ratio_idc; > + int idx; > > aspect_ratio_info_present_flag = get_bits1(gb); > > @@ -221,8 +222,10 @@ static inline int decode_vui_parameters(GetBitContext > *gb, AVCodecContext *avctx > sps->pic_struct_present_flag = get_bits1(gb); > if (!get_bits_left(gb)) > return 0; > + > sps->bitstream_restriction_flag = get_bits1(gb); > if (sps->bitstream_restriction_flag) { > + idx = gb->index; > get_bits1(gb); /* motion_vectors_over_pic_boundaries_flag */ > get_ue_golomb(gb); /* max_bytes_per_pic_denom */ > get_ue_golomb(gb); /* max_bits_per_mb_denom */ > @@ -234,6 +237,7 @@ static inline int decode_vui_parameters(GetBitContext > *gb, AVCodecContext *avctx > if (get_bits_left(gb) < 0) { > sps->num_reorder_frames = 0; > sps->bitstream_restriction_flag = 0; > + gb->index = idx;
Direct access to gb->index is not ok all code directly accssing GetBitContext internals belongs in the bitstream / get bits code. Normally to "unread" we just duplicate the GetBitContext before [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel