History

avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI

Invalidate the whole struct on SEI reset.

James Almer committed 1 year ago

Commit dd00a611 parent 046a8293 files · +5 −1Browse files

Showing the changes to libavcodec (3 of 3 files). Show all

Unified · Split

3 files
  1. libavcodec/hevc/hevcdec.c +1 −1
  2. libavcodec/hevc/sei.c +2 −0
  3. libavcodec/hevc/sei.h +2 −0
libavcodec/hevc/hevcdec.c+1−1
@@ -4106,7 +4106,7 @@ static int hevc_sei_to_context(AVCodecContext *avctx, HEVCSEI *sei) · 4105 unmodified lines
41064106 {
41074107 int ret;
41084108
4109− if (sei->tdrdi.num_ref_displays) {
4109+ if (sei->tdrdi.present) {
41104110 AVBufferRef *buf;
41114111 size_t size;
41124112 AV3DReferenceDisplaysInfo *tdrdi = av_tdrdi_alloc(sei->tdrdi.num_ref_displays, &size);
libavcodec/hevc/sei.c+2−0
@@ -217,6 +217,8 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont · 216 unmodified lines
217217 }
218218 s->three_dimensional_reference_displays_extension_flag = get_bits1(gb);
219219
220+ s->present = 1;
221+
220222 return 0;
221223 }
222224
libavcodec/hevc/sei.h+2−0
@@ -93,6 +93,7 @@ typedef struct HEVCSEITDRDI { · 92 unmodified lines
9393 uint8_t additional_shift_present_flag[32];
9494 int16_t num_sample_shift[32];
9595 uint8_t three_dimensional_reference_displays_extension_flag;
96+ int present;
9697 } HEVCSEITDRDI;
9798
9899 typedef struct HEVCSEIRecoveryPoint {
@@ -126,6 +127,7 @@ int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, · 27 unmodified lines
126127 */
127128 static inline void ff_hevc_reset_sei(HEVCSEI *sei)
128129 {
130+ sei->tdrdi.present = 0;
129131 ff_h2645_sei_reset(&sei->common);
130132 }
131133

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