Opened 4 years ago
Closed 4 years ago
#7597 closed defect (fixed)
AV_PKT_DATA_MPEGTS_STREAM_ID is broken
|Reported by:||vagran||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
In current master (90ac0e5f29ba4730cd92d3268938b3730823e52b).
char *side_data = NULL; int stream_id = -1; side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_MPEGTS_STREAM_ID, &side_data_size); if (side_data) stream_id = side_data;
One-byte stream ID is read from "char *" array to integer making it to sign-extend which is not correct. Although it writes it correctly to stream, since it is treated as one byte again, but it fails with some condition checks, e.g. in mpegtsenc.c:1278:
if (stream_id == 0xbd) /* asynchronous KLV */ pts = dts = AV_NOPTS_VALUE;
stream_id value in such case is 0xffffffbd.
Fix should be changing side_data type from "char *" to "uint8_t *".
Change History (2)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
|Status:||new → closed|
Your patch was applied as 6b1c4ce8cf600f6bd7e48b6971527b56a31b9fab - thank you for the fix!
Note: See TracTickets for help on using tickets.
Please send your patch made with
git format-patchto the FFmpeg development mailing list, patches and patch suggestions are ignored here.