You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Segfault when input contains some corrupted streams #2161
Code like this will cause segfault for some inputs with corrupted or invalid streams:
importavcontainer=av.open("input.m2ts", "r") # for certain input filesstream=container.streams[1] # select the corrupted streamprint(stream.type) # segfault here
This happens when the stream is corrupted so a general Stream rather than specific stream like VideoStream is created. So the type property invokes:
# av/stream.py@cython.cclassclassStream:
...
@propertydeftype(self):
""" The type of the stream. :type: Literal["audio", "video", "subtitle", "data", "attachment"] """returnlib.av_get_media_type_string(self.ptr.codecpar.codec_type)
The underlying av_get_media_type_string function may return NULL for unknown AVMediaType:
Activity
Fix #2161 null check for get_media_type_str
Fix PyAV-Org#2161 null check for get_media_type_str
Cherry-pick upstream bug fixes and features