- sps->offset_for_non_ref_pic = get_se_golomb(gb);
- sps->offset_for_top_to_bottom_field = get_se_golomb(gb);
+ sps->offset_for_non_ref_pic = get_se_golomb_long(gb);
+ sps->offset_for_top_to_bottom_field = get_se_golomb_long(gb);
+
+ if ( sps->offset_for_non_ref_pic == INT32_MIN
+ || sps->offset_for_top_to_bottom_field == INT32_MIN
+ ) {
+ av_log(avctx, AV_LOG_ERROR,
+ "offset_for_non_ref_pic or offset_for_top_to_bottom_field is out of range\n");
+ goto fail;
+ }
+