
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (21)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (4372)
-
Heroic Defender of the Stack
27 janvier 2011, par Multimedia Mike — ProgrammingProblem Statement
I have been investigating stack smashing and countermeasures (stack smashing prevention, or SSP). Briefly, stack smashing occurs when a function allocates a static array on the stack and writes past the end of it, onto other local variables and eventually onto other function stack frames. When it comes time to return from the function, the return address has been corrupted and the program ends up some place it really shouldn’t. In the best case, the program just crashes ; in the worst case, a malicious party crafts code to exploit this malfunction.
Further, debugging such a problem is especially obnoxious because by the time the program has crashed, it has already trashed any record (on the stack) of how it got into the errant state.
Preventative Countermeasure
GCC has had SSP since version 4.1. The computer inserts SSP as additional code when the
-fstack-protector
command line switch is specified. Implementation-wise, SSP basically inserts a special value (the literature refers to this as the ’canary’ as in "canary in the coalmine") at the top of the stack frame when entering the function, and code before leaving the function to make sure the canary didn’t get stepped on. If something happens to the canary, the program is immediately aborted with a message to stderr about what happened. Further, gcc’s man page on my Ubuntu machine proudly trumpets that this functionality is enabled per default ever since Ubuntu 6.10.And that’s really all there is to it. Your code is safe from stack smashing by default. Or so the hand-wavy documentation would have you believe.
Not exactly
Exercising the SSP
I wanted to see the SSP in action to make sure it was a real thing. So I wrote some code that smashes the stack in pretty brazen ways so that I could reasonably expect to trigger the SSP (see later in this post for the code). Here’s what I learned that wasn’t in any documentation :
SSP is only emitted for functions that have static arrays of 8-bit data (i.e., [unsigned] chars). If you have static arrays of other data types (like, say, 32-bit ints), those are still fair game for stack smashing.
Evaluating the security vs. speed/code size trade-offs, it makes sense that the compiler wouldn’t apply this protection everywhere (I can only muse about how my optimization-obsessive multimedia hacking colleagues would absolute freak out if this code were unilaterally added to all functions). So why are only static char arrays deemed to be "vulnerable objects" (the wording that the gcc man page uses) ? A security hacking colleague suggested that this is probably due to the fact that the kind of data which poses the highest risk is arrays of 8-bit input data from, e.g., network sources.
The gcc man page also lists an option
-fstack-protector-all
that is supposed to protect all functions. The man page’s definition of "all functions" perhaps differs from my own since invoking the option does not have differ in result from plain, vanilla-fstack-protector
.The Valgrind Connection
"Memory trouble ? Run Valgrind !" That may as well be Valgrind’s marketing slogan. Indeed, it’s the go-to utility for finding troublesome memory-related problems and has saved me on a number of occasions. However, it must be noted that it is useless for debugging this type of problem. If you understand how Valgrind works, this makes perfect sense. Valgrind operates by watching all memory accesses and ensuring that the program is only accessing memory to which it has privileges. In the stack smashing scenario, the program is fully allowed to write to that stack space ; after all, the program recently, legitimately pushed that return value onto the stack when calling the errant, stack smashing function.
Valgrind embodies a suite of tools. My idea for an addition to this suite would be a mechanism which tracks return values every time a call instruction is encountered. The tool could track the return values in a separate stack data structure, though this might have some thorny consequences for some more unusual program flows. Instead, it might track them in some kind of hash/dictionary data structure and warn the programmer whenever a ’ret’ instruction is returning to an address that isn’t in the dictionary.
Simple Stack Smashing Code
Here’s the code I wrote to test exactly how SSP gets invoked in gcc. Compile with ’
gcc -g -O0 -Wall -fstack-protector-all -Wstack-protector stack-fun.c -o stack-fun
’.stack-fun.c :
C :-
/* keep outside of the stack frame */
-
static int i ;
-
-
void stack_smasher32(void)
-
{
-
int buffer32[8] ;
-
// uncomment this array and compile without optimizations
-
// in order to force this function to compile with SSP
-
// char buffer_to_trigger_ssp[8] ;
-
-
for (i = 0 ; i <50 ; i++)
-
buffer32[i] = 0xA5 ;
-
}
-
-
void stack_smasher8(void)
-
{
-
char buffer8[8] ;
-
for (i = 0 ; i <50 ; i++)
-
buffer8[i] = 0xA5 ;
-
}
-
-
int main()
-
{
-
// stack_smasher8() ;
-
stack_smasher32() ;
-
return 0 ;
-
}
The above incarnation should just produce the traditional "Segmentation fault". However, uncommenting and executing stack_smasher8() in favor of stack_smasher32() should result in "*** stack smashing detected *** : ./stack-fun terminated", followed by the venerable "Segmentation fault".
As indicated in the comments for stack_smasher32(), it’s possible to trick the compiler into emitting SSP for a function by inserting an array of at least 8 bytes (any less and SSP won’t emit, as documented, unless gcc’s ssp-buffer-size parameter is tweaked). This has to be compiled with no optimization at all (-O0) or else the compiler will (quite justifiably) optimize away the unused buffer and omit SSP.
For reference, I ran my tests on Ubuntu 10.04.1 with gcc 4.4.3 compiling the code for both x86_32 and x86_64.
-
-
FFmpeg crashing on drawtext filter (ffmpeg-python)
31 août 2023, par DeadSecHey guys so im trying to use ffmpeg-python to add text to a video but its crashing at


[Parsed_drawtext_0 @ 0000012ea115ee80] Setting 'text' to value 'hi'


and I'm not sure what I can do to fix this problem. I tried pure FFmpeg command-line style and still the same issue where it gets stuck at
Setting text to value
and it simply outputs a 0byte mp4 after crashing.

My code :


os.environ['FONTCONFIG_FILE'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts\fonts.conf'
 os.environ['FONTCONFIG_PATH'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
 os.environ['FC_CONFIG_DIR'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
 in_ = ffmpeg.input(output_video_logo)
 in_ = in_.drawtext(text='hi')
 ffmpeg.output(in_, output_video).global_args('-loglevel', 'debug').run(cmd=FFMPEG_PATH)



Font config file :


<?xml version="1.0"?>


<fontconfig>





 <dir>WINDOWSFONTDIR</dir>
 <dir>~/fonts</dir>
 <dir prefix="cwd">.</dir>
 <dir>~/.fonts</dir>


 <match target="pattern">
 <test qual="any">
 <string>mono</string>
 </test>
 <edit mode="assign">
 <string>monospace</string>
 </edit>
 </match>


 <match target="pattern">
 <test qual="any">
 <string>sans serif</string>
 </test>
 <edit mode="assign">
 <string>sans-serif</string>
 </edit>
 </match>


 <match target="pattern">
 <test qual="any">
 <string>sans</string>
 </test>
 <edit mode="assign">
 <string>sans-serif</string>
 </edit>
 </match>


 <include>conf.d</include>



 <cachedir>WINDOWSTEMPDIR_FONTCONFIG_CACHE</cachedir>
 <cachedir>~/.fontconfig</cachedir>

 <config>


 <rescan>
 <int>30</int>
 </rescan>
 </config>

</fontconfig>



Is this a issue with any of my fontconfig or script ? I'm really lost on fixing this.


As requested by Rotem tried adding new input to drawtext and this was the output before crashing with no error message :
Successfully opened the file.


[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'box' to value '1'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'boxcolor' to value 'yellow'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'fontcolor' to value 'blue'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'fontsize' to value '72'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'text' to value 'hi'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'x' to value '10'
[Parsed_drawtext_0 @ 00000171a2f0f900] Setting 'y' to value '10'



Full log :
https://pastebin.com/E6sHvwUz


-
ffmpeg muxing time getting an error
5 février 2017, par Asif Shariari am getting error when i muxing a file ,i try to mux a file i use muxing example , but i always geting an error in ret does not meet ffmpeg ptr value ,
is use this code
OutputStream video_st = { 0 }, audio_st = { 0 };
const char *filename;
AVOutputFormat *fmt;
AVFormatContext *oc;
AVCodec *audio_codec = nullptr, *video_codec = nullptr;
int ret;
int have_video = 0, have_audio = 0;
int encode_video = 0, encode_audio = 0;
AVDictionary *opt = NULL;
int i;
/* Initialize libavcodec, and register all codecs and formats. */
av_register_all();
filename = "C:/Users/Admin/Desktop/Videotest/_test.mp4";
/* allocate the output media context */
avformat_alloc_output_context2(&oc, NULL, NULL, filename);
if (!oc) {
printf("Could not deduce output format from file extension: using MPEG.\n");
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
}
if (!oc) {
exit;
}
fmt = oc->oformat;
/* Add the audio and video streams using the default format codecs
* and initialize the codecs. */
if (fmt->video_codec != AV_CODEC_ID_NONE) {
add_stream(&video_st, oc, &video_codec, fmt->video_codec);
have_video = 1;
encode_video = 1;
}
if (fmt->audio_codec != AV_CODEC_ID_NONE) {
add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec);
have_audio = 1;
encode_audio = 1;
}
/* Now that all the parameters are set, we can open the audio and
* video codecs and allocate the necessary encode buffers. */
if (have_video)
open_video(oc, video_codec, &video_st, opt);
if (have_audio)
open_audio(oc, audio_codec, &audio_st, opt);
av_dump_format(oc, 0, filename, 1);
/* open the output file, if needed */
if (!(fmt->flags & AVFMT_NOFILE)) {
ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE);
if (ret < 0) {
exit;
}
}
/* Write the stream header, if any. */
ret = avformat_write_header(oc, &opt);
if (ret < 0) {
exit;
}
while (encode_video || encode_audio) {
/* select the stream to encode */
if (encode_video &&
(!encode_audio || av_compare_ts(video_st.next_pts, video_st.enc->time_base,
audio_st.next_pts, audio_st.enc->time_base) <= 0)) {
encode_video = !write_video_frame(oc, &video_st);
}
else {
encode_audio = !write_audio_frame(oc, &audio_st);
}
}
/* Write the trailer, if any. The trailer must be written before you
* close the CodecContexts open when you wrote the header; otherwise
* av_write_trailer() may try to use memory that was freed on
* av_codec_close(). */
av_write_trailer(oc);
/* Close each codec. */
if (have_video)
close_stream(oc, &video_st);
if (have_audio)
close_stream(oc, &audio_st);
if (!(fmt->flags & AVFMT_NOFILE))
/* Close the output file. */
avio_closep(&oc->pb);
/* free the stream */
avformat_free_context(oc);error logs
av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n");
error getting here
/* Write the stream header, if any. */
ret = avformat_write_header(oc, &opt);how can i fix this error