Mercurial > mplayer.hg
comparison libmpdemux/muxer_mpeg.c @ 17814:8f2e94a4a4c1
check pce_ptr before using it; fixes cid 207
author | nicodvb |
---|---|
date | Sat, 11 Mar 2006 23:15:57 +0000 |
parents | 22ced3e0a4aa |
children | 36a155ee4d27 |
comparison
equal
deleted
inserted
replaced
17813:f34f61843448 | 17814:8f2e94a4a4c1 |
---|---|
1792 static int soft_telecine(muxer_headers_t *vpriv, uint8_t *fps_ptr, uint8_t *se_ptr, uint8_t *pce_ptr, int n) | 1792 static int soft_telecine(muxer_headers_t *vpriv, uint8_t *fps_ptr, uint8_t *se_ptr, uint8_t *pce_ptr, int n) |
1793 { | 1793 { |
1794 uint8_t fps, tff, rff; | 1794 uint8_t fps, tff, rff; |
1795 int period; | 1795 int period; |
1796 | 1796 |
1797 if(! pce_ptr) | |
1798 return 0; | |
1799 | |
1797 period = (vpriv->telecine == TELECINE_FILM2PAL) ? 12 : 4; | 1800 period = (vpriv->telecine == TELECINE_FILM2PAL) ? 12 : 4; |
1798 if(fps_ptr != NULL) | 1801 if(fps_ptr != NULL) |
1799 { | 1802 { |
1800 fps = *fps_ptr & 0x0f; | 1803 fps = *fps_ptr & 0x0f; |
1801 if((!fps) || (fps > FRAMERATE_24)) | 1804 if((!fps) || (fps > FRAMERATE_24)) |
1827 vpriv->picture.progressive_sequence = 0; | 1830 vpriv->picture.progressive_sequence = 0; |
1828 vpriv->picture.progressive_frame = 1; | 1831 vpriv->picture.progressive_frame = 1; |
1829 if(se_ptr) | 1832 if(se_ptr) |
1830 se_ptr[1] &= 0xf7; | 1833 se_ptr[1] &= 0xf7; |
1831 | 1834 |
1832 if(! pce_ptr) | |
1833 return 0; | |
1834 | 1835 |
1835 if(! vpriv->vframes) //initial value of tff | 1836 if(! vpriv->vframes) //initial value of tff |
1836 vpriv->trf = (pce_ptr[3] >> 6) & 0x2; | 1837 vpriv->trf = (pce_ptr[3] >> 6) & 0x2; |
1837 | 1838 |
1838 while(n < 0) n+=period; | 1839 while(n < 0) n+=period; |