fix(avi_player): strl_parser fail cause divide zero bug#689
Open
flespark wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In avi_player, if
strl_parserhave not parse any valid video stream,avi_parserstill return 0,avi_playerfunction will step onto remain data parse process, run into divide zero panic atuint32_t fps_time = 1000 * 1000 / s_avi->avi_data.AVI_file.vids_fps;Note
Found and fixed in avi_player v1.0.0, log as follow:
I (29432) avifile: Find a video stream
E (29432) avifile: only support mjpeg\h264 decoder, but needed is 0x34504d46
E (29432) avifile: strl of stream0 prase failed
I (29432) avifile: movi pos:5678, size:48502
I (29432) REST_SERVER: check_avi_format: AVI info - 0x0 @ 0 fps, MJPEG format
I (29442) REST_SERVER: check_avi_format: file format is supported
I (29622) REST_SERVER: file finalized: /nvm/video_1774769102890.avi
E (871) avifile: only support mjpeg\h264 decoder, but needed is 0x34504d46
E (871) avifile: strl of stream0 prase failed
I (871) avifile: movi pos:5678, size:48502
Guru Meditation Error: Core 0 panic'ed (IntegerDivideByZero). Exception was unhandled.
Core 0 register dump:
PC : 0x4201a75f PS : 0x00060730 A0 : 0x8201a95d A1 : 0x3fce5df0
--- 0x4201a75f: avi_player at /Users/simon/Project/esp_player/sw_v1/managed_components/espressif__avi_player/avi_player.c:153
A2 : 0x00000002 A3 : 0x0000000f A4 : 0x3fce4f6c A5 : 0x00010000
A6 : 0xffffffff A7 : 0x3fcac464 A8 : 0x3fce4ec8 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3c166350 A12 : 0x000f4240 A13 : 0x5453494c
A14 : 0x69766f6d A15 : 0x3c167972 SAR : 0x00000004 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffffd
--- 0x400556d5: strlen in ROM
--- 0x400556e5: strlen in ROM
test video file attached
新建文件夹.zip