You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/utils: constrain the lifetime of the pointer returned by avformat_index_get_entry()
This will give us more room to improve the implementation later. Suggested-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -2535,10 +2535,10 @@ int avformat_index_get_entries_count(const AVStream *st);
|
|||||||
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
|
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
|
||||||
*
|
*
|
||||||
* @note The pointer returned by this function is only guaranteed to be valid
|
* @note The pointer returned by this function is only guaranteed to be valid
|
||||||
* until any function that could alter the stream or the AVFormatContext
|
* until any function that takes the stream or the parent AVFormatContext
|
||||||
* that contains it is called.
|
* as input argument is called.
|
||||||
*/
|
*/
|
||||||
const AVIndexEntry *avformat_index_get_entry(const AVStream *st, int idx);
|
const AVIndexEntry *avformat_index_get_entry(AVStream *st, int idx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the AVIndexEntry corresponding to the given timestamp.
|
* Get the AVIndexEntry corresponding to the given timestamp.
|
||||||
@@ -2552,10 +2552,10 @@ const AVIndexEntry *avformat_index_get_entry(const AVStream *st, int idx);
|
|||||||
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
|
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
|
||||||
*
|
*
|
||||||
* @note The pointer returned by this function is only guaranteed to be valid
|
* @note The pointer returned by this function is only guaranteed to be valid
|
||||||
* until any function that could alter the stream or the AVFormatContext
|
* until any function that takes the stream or the parent AVFormatContext
|
||||||
* that contains it is called.
|
* as input argument is called.
|
||||||
*/
|
*/
|
||||||
const AVIndexEntry *avformat_index_get_entry_from_timestamp(const AVStream *st,
|
const AVIndexEntry *avformat_index_get_entry_from_timestamp(AVStream *st,
|
||||||
int64_t wanted_timestamp,
|
int64_t wanted_timestamp,
|
||||||
int flags);
|
int flags);
|
||||||
/**
|
/**
|
||||||
|
@@ -2057,7 +2057,7 @@ int avformat_index_get_entries_count(const AVStream *st)
|
|||||||
return st->internal->nb_index_entries;
|
return st->internal->nb_index_entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AVIndexEntry *avformat_index_get_entry(const AVStream *st, int idx)
|
const AVIndexEntry *avformat_index_get_entry(AVStream *st, int idx)
|
||||||
{
|
{
|
||||||
if (idx < 0 || idx >= st->internal->nb_index_entries)
|
if (idx < 0 || idx >= st->internal->nb_index_entries)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -2065,7 +2065,7 @@ const AVIndexEntry *avformat_index_get_entry(const AVStream *st, int idx)
|
|||||||
return &st->internal->index_entries[idx];
|
return &st->internal->index_entries[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
const AVIndexEntry *avformat_index_get_entry_from_timestamp(const AVStream *st,
|
const AVIndexEntry *avformat_index_get_entry_from_timestamp(AVStream *st,
|
||||||
int64_t wanted_timestamp,
|
int64_t wanted_timestamp,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user