File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
crates/utils/re_video/src/demux Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -465,6 +465,10 @@ impl VideoDataDescription {
465
465
media_type : & str ,
466
466
debug_name : & str ,
467
467
) -> Result < Self , VideoLoadError > {
468
+ if data. is_empty ( ) {
469
+ return Err ( VideoLoadError :: ZeroBytes ) ;
470
+ }
471
+
468
472
re_tracing:: profile_function!( ) ;
469
473
match media_type {
470
474
"video/mp4" => Self :: load_mp4 ( data, debug_name) ,
@@ -829,7 +833,10 @@ impl SampleMetadata {
829
833
/// Errors that can occur when loading a video.
830
834
#[ derive( thiserror:: Error , Debug ) ]
831
835
pub enum VideoLoadError {
832
- #[ error( "Failed to determine media type from data: {0}" ) ]
836
+ #[ error( "The video file is empty (zero bytes)" ) ]
837
+ ZeroBytes ,
838
+
839
+ #[ error( "MP4 error: {0}" ) ]
833
840
ParseMp4 ( #[ from] re_mp4:: Error ) ,
834
841
835
842
#[ error( "Video file has no video tracks" ) ]
You can’t perform that action at this time.
0 commit comments